Oleg Kalnichevski commented on HTTPCLIENT-1903:

Hi Gary
We _should_ not make API visible changes in GA branches. We _really_ should 
not. We break this rule left and right because going though a full ALPHA / BETA 
/ GA cycle for an extra setter in an existing class is too much of a hassle. It 
is unfortunate but such is life. We have development branches for new features 
/ larger change sets. 4.6.x has never been released because no one appears to 
be interested in working on it. Next release in the 4.6.x _should_ be 
Effectively we are already maintaining 3 active branches, so our sanity has 
long been compromised. 


> DefaultHostnameVerifier crashes on Android due to inexistent javax.naming 
> classes
> ---------------------------------------------------------------------------------
>                 Key: HTTPCLIENT-1903
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1903
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>    Affects Versions: 4.5.5
>            Reporter: Michael Pujos
>            Priority: Minor
> I'm using HttpClient on Android, repackaged to avoid conficting with the 
> platform's org.apache old packages.
> It works fine, except that making any https request will crash using the 
> defaults.
> The reason is that DefaultHostnameVerifier uses javax.naming.* classes, which 
> are not present on Android.
> So to be able to make https request, the default hostname verifier must be 
> replaced. For example:
> httpClient = HttpClients.custom()
>                 .setSSLHostnameVerifier(NoopHostnameVerifier.INSTANCE)
>                 .build();
> Using NoopHostnameVerifier is rarely a good idea, so for the time being I 
> have replaced it with and older version of BrowserCompatHostnameVerifier that 
> doesn't internally call DefaultHostnameVerifier.
> Ideally, I'd like DefaultHostnameVerifier to detect dynamically if 
> javax.naming.* classes are available, and switch to an alternate method not 
> using them if they are not. That way, HttpClient would work out of the box 
> for Android users.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to