13
votes

I need to connect to a webservice which only accepts connections established via TLS 1.2. Other versions are not supported.

My test client (soapUI Pro) uses JRE 1.7_45 which - according to the following link - generally supports TLS 1.2 which is not enabled by default for clients. I don't have control over the test client's source code so I need to enable TLS 1.2 via some Java options or else.

http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html#tlsprotonote

However I cannot find any information how to enable TLS 1.2 for the JVM.

2

2 Answers

27
votes

The following parameter must be added to the soapUI vmoptions file in soapUI's bin directory:

-Dsoapui.https.protocols=TLSv1.2
8
votes

You need to pass the protocol to SSLContext - docs

SSLContext context = SSLContext.getInstance("TLSv1.2");

You can then use context to create an SSLEngine

context.createSSLEngine();

Read the JSSE guide on how to make SSL connections using SSLEngine