diff --git a/RELEASE_NOTES.txt b/RELEASE_NOTES.txt index 95ceac3cd..41373b981 100644 --- a/RELEASE_NOTES.txt +++ b/RELEASE_NOTES.txt @@ -17,6 +17,8 @@ Changelog: * [HTTPCLIENT-1816] Update Apache Commons Codec 1.9 to 1.10. Contributed by Gary Gregory +* [HTTPCLIENT-1836] DefaultHostnameVerifier#getSubjectAltNames(X509Certificate) throws java.lang.ClassCastException. + Contributed by Gary Gregory , Ilian Iliev Release 4.5.3 ------------------- diff --git a/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java b/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java index 982674e1a..2202abe16 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java +++ b/httpclient/src/main/java/org/apache/http/conn/ssl/DefaultHostnameVerifier.java @@ -305,8 +305,12 @@ public final class DefaultHostnameVerifier implements HostnameVerifier { 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;