Ensure X509HostnameVerifier is never null
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1528614 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
d9e2140b12
commit
08140864e3
|
@ -1,6 +1,9 @@
|
|||
Changes since 4.3
|
||||
-------------------
|
||||
|
||||
* Ensure X509HostnameVerifier is never null.
|
||||
Contributed by Oleg Kalnichevski <olegk at apache.org>
|
||||
|
||||
* [HTTPCLIENT-1405] CONNECT HTTP/1.1 requests lack mandatory 'Host' header.
|
||||
Contributed by Oleg Kalnichevski <olegk at apache.org>
|
||||
|
||||
|
|
|
@ -699,6 +699,10 @@ public class HttpClientBuilder {
|
|||
if (connManager == null) {
|
||||
LayeredConnectionSocketFactory sslSocketFactory = this.sslSocketFactory;
|
||||
if (sslSocketFactory == null) {
|
||||
X509HostnameVerifier hostnameVerifier = this.hostnameVerifier;
|
||||
if (hostnameVerifier == null) {
|
||||
hostnameVerifier = SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER;
|
||||
}
|
||||
if (sslcontext != null) {
|
||||
sslSocketFactory = new SSLConnectionSocketFactory(sslcontext, hostnameVerifier);
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue