You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2017/03/28 18:50:01 UTC

svn commit: r1789188 - in /httpcomponents/httpclient/branches/4.5.x: RELEASE_NOTES.txt httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java

Author: ggregory
Date: Tue Mar 28 18:50:01 2017
New Revision: 1789188

URL: http://svn.apache.org/viewvc?rev=1789188&view=rev
Log:
[HTTPCLIENT-1836] DefaultHostnameVerifier#getSubjectAltNames(X509Certificate) throws java.lang.ClassCastException.
  Contributed by Gary Gregory <ggregory at apache.org>, Ilian Iliev <ilian_iliev at yahoo.com>

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

Modified: httpcomponents/httpclient/branches/4.5.x/RELEASE_NOTES.txt
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.5.x/RELEASE_NOTES.txt?rev=1789188&r1=1789187&r2=1789188&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.5.x/RELEASE_NOTES.txt (original)
+++ httpcomponents/httpclient/branches/4.5.x/RELEASE_NOTES.txt Tue Mar 28 18:50:01 2017
@@ -23,6 +23,9 @@ Changelog:
 * [HTTPCLIENT-1828] HttpDelete does not extend HttpEntityEnclosingRequestBase.
   Contributed by Saravanakumar Selvaraj <saravanakumar dot java at gmail dot com> and Gary Gregory <ggregory at apache.org>
 
+* [HTTPCLIENT-1836] DefaultHostnameVerifier#getSubjectAltNames(X509Certificate) throws java.lang.ClassCastException.
+  Contributed by Gary Gregory <ggregory at apache.org>, Ilian Iliev <ilian_iliev at yahoo.com>
+
 
 Release 4.5.3
 -------------------

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=1789188&r1=1789187&r2=1789188&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 Tue Mar 28 18:50:01 2017
@@ -305,8 +305,12 @@ public final class DefaultHostnameVerifi
             for (final List<?> entry : entries) {
                 final Integer type = entry.size() >= 2 ? (Integer) entry.get(0) : null;
                 if (type != null) {
-                    final String s = (String) entry.get(1);
-                    result.add(new SubjectName(s, type));
+                    final Object o = entry.get(1);
+                    if (o instanceof String) {
+                        result.add(new SubjectName((String) o, type.intValue()));
+                    } else if (o instanceof byte[]) {
+                        // TODO ASN.1 DER encoded form
+                    }
                 }
             }
             return result;