Scott Carlson created HTTPCLIENT-1851:
-----------------------------------------

             Summary: Regression ClassCastException when connecting SSL
                 Key: HTTPCLIENT-1851
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1851
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpClient (classic)
    Affects Versions: 4.5.3
            Reporter: Scott Carlson


I have a small program that makes a Rest call to get some data.   With 
'org.apache.httpcomponents:httpclient:4.5.2', it works fine.  
Upgrading to org.apache.httpcomponents:httpclient:4.5.3, I'm getting a 
ClassCastException. Nothing else changed.  4.5.2 doesn't even seem to go 
through this code path at all.

09:24:02.987 [main] DEBUG 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager - Connection 
released: [id: 0][route: {s}->https://testserver:9091][total kept alive: 0; 
route allocated: 0 of 2; total allocated: 0 of 20]
Exception in thread "main" java.lang.ClassCastException: [B cannot be cast to 
java.lang.String
        at 
org.apache.http.conn.ssl.DefaultHostnameVerifier.getSubjectAltNames(DefaultHostnameVerifier.java:309)
        at 
org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:136)
        at 
org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:123)
        at 
org.apache.http.conn.ssl.SSLConnectionSocketFactory.verifyHostname(SSLConnectionSocketFactory.java:463)
        at 
org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:397)
        at 
org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:355)
        at 
org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
        at 
org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
        at 
org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
        at 
org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
        at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
        at 
org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
        at 
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
        at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
        at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
        at 
org.springframework.http.client.HttpComponentsClientHttpRequest.executeInternal(HttpComponentsClientHttpRequest.java:89)
        at 
org.springframework.http.client.AbstractBufferingClientHttpRequest.executeInternal(AbstractBufferingClientHttpRequest.java:48)
        at 
org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:53)
        at 
org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:652)
        at 
org.springframework.web.client.RestTemplate.execute(RestTemplate.java:628)
        at 
org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:303)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to