[
https://issues.apache.org/jira/browse/HTTPCLIENT-1903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16356969#comment-16356969
]
Gary Gregory commented on HTTPCLIENT-1903:
------------------------------------------
Hi [~olegk]:
You've analyzed my patch correctly. I can now see that the solution in 5.x is
cleaner. It seems reasonable to port the change to a 4.x branch. But which
one(s)? We've not had a 4.6.0 release yet. Are you saying that this patch
could/would deprecate 4.5.5 in favor of an upcoming 4.6.0? Would the next
release be 4.6.0 as opposed to 4.5.6? Or, we would loose our sanity or waste
time maintaining three active branches?
I am not able to port my main app from 4.x to 5.x due to time restrictions, so
I am fully invested in keeping 4.x as high quality as possible, bug free, and
powerful for at least a few months before I can consider porting to 5.x and
focusing there.
Thoughts?
Gary
> 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
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]