hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joan Balagueró <joan.balagu...@grupoventus.com>
Subject SSL and stale check changes
Date Wed, 01 Apr 2015 13:50:20 GMT
Hello,

 

I’ve just installed HC4.4.1 and some methods related to ssl are deprecated.
Concretely this piece of code:

 

   SSLContext sslContext = SSLContexts.custom().useTLS().build();

   sslContext.init(keyManagers, null, null);

 

   return (new SSLConnectionSocketFactory(sslContext,
SSLConnectionSocketFactory.STRICT_HOSTNAME_VERIFIER));

 

 

But taking a look at the HC4.4. documentation, section 2.7.3., I still see
this way of building a SSLContext.

 

Which methods should I use now? Maybe the SSLContexts.createSystemDefault()?
Does this method create a SSLContext with TLS like the previous one? And how
can I create a SSLConnectionFactory with strict hostname verifier?

 

Furthermore, the following method is also deprecated:

 

  this.rc = RequestConfig.custom().setAuthenticationEnabled(false).

 
setConnectionRequestTimeout(1).

 
setConnectTimeout(this.connectionTimeout).

 
setSocketTimeout(this.responseTimeout).

 
setExpectContinueEnabled(false).

 
setStaleConnectionCheckEnabled(false).

                                                setRedirectsEnabled(false).

                                                        build();

 

I know that stale checking has been improved in this version, but how can I
use it?

 

Thanks,

 

Joan. 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message