HTTPClient-java.net.SocketException: Unconnected sockets not implemented thrown

后端 未结 2 1061
说谎
说谎 2021-01-06 06:07

Iam using HTTPClient 4.0 to connect a remote server and transfer file using HTTPS. When i tried to connect i get the exception \"java.net.SocketException: Unconnected socke

2条回答
  •  渐次进展
    2021-01-06 06:35

    When I enabled javax.net.debug, I noticed that there was a missing class com.ibm.websphere.com.ibm.websphere.ssl.protocol.SSLSocketFactory.

    I was experiencing trouble in unit tests that invoke httpclient. What I ended up doing was to add this line to my TestClass.setUp()

    Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");
    

提交回复
热议问题