Skip to content

Commit

Permalink
Ensure X509HostnameVerifier is never null
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1528614 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
ok2c committed Oct 2, 2013
1 parent d9e2140 commit 0814086
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.txt
@@ -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>

Expand Down
Expand Up @@ -699,6 +699,10 @@ public CloseableHttpClient build() {
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 {
Expand Down

0 comments on commit 0814086

Please sign in to comment.