Commit 0d34a855 authored by Alex Klyubin's avatar Alex Klyubin
Browse files

Honor getDefaultHostnameVerifier in HttpsHandler.

This makes HttpsHandler (a provider of HttpsURLConnection
implementation) honor the contract of HttpsURLConnection which is
that new instances of HttpsURLConnection will use the
HostnameVerifier returned by
HttpsURLConnection.getDefaultHostnameVerifier unless modified by
HttpsURLConnection.setHostnameVerifier.

To achieve the above, this CL removes a workaround for when this
library is used in standalone/static way (as opposed to being
included in the Android platform). In this situation using the
platform-provided default HostnameVerifier may not be a good idea
because the platform may be outdated. However, rather than checking
which HostnameVerifier is offered by the platform by default and
ignoring if it's the platform-default implementation, the correct
solution is to explicitly set the verifier to be used by default,
by invoking HttpsURLConnection.setDefaultHostnameVerifier in the
same block of code which registers this library's HttpsHandler as
the provider of HttpsURLConnection instances.

Bug: 18481199
Change-Id: I975d767647882e09ebfd7a83ef383310140a5dca
parent fadae63e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment