Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.5.3, 5.0 Alpha1
-
None
Description
After upgrade to HttpClient 4.5.3, all of a sudden I started to receive the following exception in one of my projects:
java.lang.ClassCastException: [B cannot be cast to java.lang.String
The exception is thrown in DefaultHostnameVerifier#getSubjectAltNames() method, on line 309:
final String s = (String) entry.get(1);
The code above assumes that each entry is either a String or something castable to String. However, according to Javadoc documentation of X509Certificate.getSubjectAlternativeNames(), it can be a byte array containing ASN.1 DER encoded value. Attempt to cast this byte array to String is throwing java.lang.ClassCastException.
Seems to be a regression introduced in version 4.5.3 with the fix for HTTPCLIENT-1802
Attachments
Issue Links
- is duplicated by
-
HTTPCLIENT-1851 Regression ClassCastException when connecting SSL
- Resolved
- relates to
-
MNG-6388 Error Fetching Artifacts: "[B cannot be cast to java.lang.String"
- Closed