I'm trying to enable TLS 1.2 in a SOAPConnection in Java 7 running on Jboss 7.1. I have read that the property https.protocols works only whit HttpURLConnection:
System.setProperty("https.protocols", "TLSv1.2")
;
I have found a lot of solutions that say to use SSLContext:
SSLContext context = SSLContext.getInstance("TLSv1.2");
context.init(null, null, new SecureRandom());
SSLContext.setDefault(context);
I have placed the code before the creation of my SOAPConnectionFactory, but that doesn't work for me.
This is my code:
SOAPConnectionFactory soapFactory = SOAPConnectionFactory.newInstance();
SOAPConnection soapConnection = soapFactory.createConnection();
SOAPMessage soapResponse = soapConnection.call(soapMessage, url);
Did you have any solutions? Thank's a lot
EDIT: It works, if I declare the SSLContext in the Interceptor.