Reputation: 1456
I am passing JVM parameter as -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2. But in code ,I am explicitly getting the SSL context object as
SSLContext sc = null;
sc = SSLContext.getInstance("TLS");
.
Will the TLS version be highest version (1.2) in this case, or i need to explicitly get the TLS version as
sc = SSLContext.getInstance("TLSv1.2");
to support TLS version 1.2
Upvotes: 2
Views: 1367
Reputation: 262644
Probably not.
According to the documentation, this setting is only used by HttpsURLConnection and URl#openStream.
https.protocols
Controls the protocol version used by Java clients which obtain https connections through use of the HttpsURLConnection class or via URL.openStream() operations.
If you directly obtain your own SSLContext, the setting is likely not consulted.
Upvotes: 1