On Thu, 2013-01-03 at 07:57 -0700, Billy Newman wrote:
> Looking through the code I am have a hard time trying to understand
> the easiest way to get a SystemDefaultHttpClient with the host name
> verifier set to ALLOW_ALL_HOSTNAME_VERIFIER.
> 
> I have the following code:
> 
> SystemDefaultHttpClient client =  new SystemDefaultHttpClient();
> SSLSocketFactory sf = SSLSocketFactory.getSystemSocketFactory();
> sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
> client.getConnectionManager().getSchemeRegistry().register(new
> Scheme("https", 443, sf);
> 
> The problem with this is that the sf.setHostnameVerifier(...) is
> depreciated.  Looking at the depreciation comments I do not see and
> hints on what I should use to set the host name verifier.
> 
> I don't really want to duplicate all the code to pull in the system
> properties to create  a 'System' SocketFactory, but I see no other way
> to set the host name verifier.
> 
> Any ideas?
> 
> Thanks in advance!
> 
> Billy
> 

It is not possible to choose a custom HostnameVerifier when using system
configuration. Please raise a change request in JIRA for this issue. For
the time being there is no way around using the deprecated setter
method.

Oleg 



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to