hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wkeenan <wayne.kee...@gmail.com>
Subject Re: HttpClient v4 in Google App Engine fails with SSL errro for HTTP connection
Date Tue, 14 Apr 2009 10:25:38 GMT

Hi Oleg,

After looking around the  classes in your helpful snippet I think GAE will
not be a place to run HTTPClient at the moment, as GAE outlaws the use of
Sockets, but allows URLConnection.  
I can't see a way to drop in a URLConnection only Scheme.

Thanks for taking your time to get back to me though.

Regards
Wayne


olegk wrote:
> 
> On Mon, Apr 13, 2009 at 07:16:48AM -0700, wkeenan wrote:
>   
>> But my question is why is HTTPClient even going near the SSL  for a HTTP
>> connection?
>> 
> 
> HttpClient creates a socket factory for the https scheme upon
> initialization.
> 
>> Is there something I can explicitly set to indicate the URL in the
>> HttpGet
>> is only HTTP so please don't go looking into SSL Sockets Mr HttpClient?
>> 
> 
> Yes, absolutely. You will, however, have to do a little more work to
> initialize HttpClient's connection manager:
> 
> SchemeRegistry schemeRegistry = new SchemeRegistry();
> schemeRegistry.register(
>   new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
> BasicHttpParams params = new BasicHttpParams();
> SingleClientConnManager connmgr = 
>   new SingleClientConnManager(params, schemeRegistry);
> DefaultHttpClient httpclient = new DefaultHttpClient(connmgr, params); 
> 
> Hope this helps
> 
> Oleg
> 
> 
>> Thanks
>> Wayne
>> 
>> 
>> The Excpetion:
>> 
>> java.lang.NoClassDefFoundError: javax.net.ssl.HttpsURLConnection is a
>> restricted class. Please see the Google App Engine developer's guide for
>> more details.
>>         at
>> com.google.apphosting.runtime.security.shared.stub.javax.net.ssl.HttpsURLConnection.<clinit>(HttpsURLConnection.java)
>>         at
>> org.apache.http.conn.ssl.SSLSocketFactory.<init>(SSLSocketFactory.java:244)
>>         at
>> org.apache.http.conn.ssl.SSLSocketFactory.<clinit>(SSLSocketFactory.java:157)
>>         at
>> org.apache.http.impl.client.DefaultHttpClient.createClientConnectionManager(DefaultHttpClient.java:160)
>>         at
>> org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:221)
>>         at
>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:539)
>>         at
>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
>>         at
>> org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
>>         at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:444)
>>         at groovyx.net.http.HTTPBuilder.doRequest(HTTPBuilder.java:416)
>>         at groovyx.net.http.HTTPBuilder.request(HTTPBuilder.java:365) 
>> -- 
>> View this message in context:
>> http://www.nabble.com/HttpClient-v4-in-Google-App-Engine-fails-with-SSL-errro-for-HTTP-connection-tp23022919p23022919.html
>> Sent from the HttpClient-User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/HttpClient-v4-in-Google-App-Engine-fails-with-SSL-errro-for-HTTP-connection-tp23022919p23036829.html
Sent from the HttpClient-User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message