Force AXIS client to use TLS

后端 未结 1 1109
谎友^
谎友^ 2021-02-10 01:09

How can I force a SOAP Axis client to use TLS instead of SSL? I have this code:

        SOAPMessage soapMessage = MessageFactory.newInstance()
                .c         


        
1条回答
  •  执笔经年
    2021-02-10 01:57

    try {
            SSLContext ctx = SSLContext.getInstance("TLSv1.2");
            ctx.init(null, null, null);
            SSLContext.setDefault(ctx);
        } catch (Exception e) {
                System.out.println(e.getMessage());
        }
    

    You can use this code the set the default protocol for SSL to TLS 1.2 and then write your other statements.

    0 讨论(0)
提交回复
热议问题