hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1745908 - /httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java
Date Sat, 28 May 2016 17:01:12 GMT
Author: olegk
Date: Sat May 28 17:01:12 2016
New Revision: 1745908

URL: http://svn.apache.org/viewvc?rev=1745908&view=rev
Log:
HTTPCLIENT-1744: normalize hostname and certificate CN when matching to CN

Modified:
    httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java

Modified: httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java?rev=1745908&r1=1745907&r2=1745908&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java
(original)
+++ httpcomponents/httpclient/branches/4.5.x/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java
Sat May 28 17:01:12 2016
@@ -176,7 +176,9 @@ public final class DefaultHostnameVerifi
 
     static void matchCN(final String host, final String cn,
                  final PublicSuffixMatcher publicSuffixMatcher) throws SSLException {
-        if (!matchIdentityStrict(host, cn, publicSuffixMatcher)) {
+        final String normalizedHost = host.toLowerCase(Locale.ROOT);
+        final String normalizedCn = cn.toLowerCase(Locale.ROOT);
+        if (!matchIdentityStrict(normalizedHost, normalizedCn, publicSuffixMatcher)) {
             throw new SSLException("Certificate for <" + host + "> doesn't match "
+
                     "common name of the certificate subject: " + cn);
         }



Mime
View raw message