SSL Connection Reset

后端 未结 1 1526
孤街浪徒
孤街浪徒 2020-11-29 04:30

I am attempting to connect to an HTTPS endpoint in Java. Every method I have tried (more details below) ends up generating this stack trace:

java.net.SocketE         


        
相关标签:
1条回答
  • 2020-11-29 04:32

    It is an SSL version problem. The server only supports SSLv3, and Java will start at v2, and attempt to negotiate upwards, but not all servers support that type of negotiation.

    Forcing java to use SSLv3 only is the only solution I'm aware of.

    Edit, there are two ways to do this that I'm aware of:

    • If you are creating the socket by hand, you can set the enabled protocols

      socket.setEnabledProtocols(new String[] { "SSLv3" });
      
    • If you are using a higher level library, you probably need to set all SSL requests to use v3 only, which is accomplished with the "https.protocols" system property:

      java -Dhttps.protocols=SSLv3
      
    0 讨论(0)
提交回复
热议问题