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

后端 未结 2 1043
说谎
说谎 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:31

    Actually a more complete answer than suppressingfire is

    1. Add com.ibm.ws.admin.client_7.0.0.jar to java build

      This solves the java.lang.NoClassDefFoundError: com.ibm.ffdc.Manager error.

    2. Add to setup:

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

      This solves the Cannot find the specified class com.ibm.websphere.ssl.protocol.SSLSocketFactory

    0 讨论(0)
  • 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");
    
    0 讨论(0)
提交回复
热议问题