HTTP over TLS

87 views
Skip to first unread message

Santosh Dandey

unread,
Apr 5, 2013, 11:10:04 AM4/5/13
to google-http...@googlegroups.com
Hello,

I'm trying to re-do the existing httpclient web-service consumer calls to google http client and I ran into an issues.  Does the google http client supports HTTP over TLS.  if yes, can you provide a sample snippet that allows me to do the same in a simple way.  Basically, what I'm looking is to convert the below code to utilize google api.  Any suggestions?


  httpclient = new DefaultHttpClient(params);

    SSLContext sslcontext = SSLContext.getInstance("TLS");

    // sslcontext.init(null, new TrustManager[] {easyTrustManager}, null);
    SSLSocketFactory sf = new SSLSocketFactory(sslcontext);
    sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
    Scheme sch = new Scheme("https", sf, PORT); // PORT = 443
    httpclient.getConnectionManager().getSchemeRegistry().register(sch);


Please, advise

Santosh

Nick Miceli

unread,
Apr 26, 2013, 4:30:18 PM4/26/13
to google-http...@googlegroups.com
Hi,

The Google HTTP Client certainly does support HTTP over TLS.  For a code sample very similar to what you provided, take a look at the ApacheHttpTransport class, in the static newDefaultHttpClient method. 

Best,
Nick



Santosh

--
You received this message because you are subscribed to the Google Groups "google-http-java-client" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-http-java-...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages