On Mon, Apr 13, 2009 at 07:16:48AM -0700, wkeenan wrote:
>
> Hi,
>
> I'm not sure if this is a bug, potential feature request, or a usage error
> on my part, but when I deployed a very simple servlet to the GoogleApp
> engine to perform a HTTP GET on a HTTP URL but I received a SSL related
> sandbox error. URLConnection connections should (and do) work, SSL ones
> are banned in GAE.
> 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: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]