I read in an article that HttpsURLConnection
will transparently negotiate the SSL connection.
The official document says:
This class uses HostnameVerifier and SSLSocketFactory. There are default implementations defined for both classes. [1]
Does that mean once you open a connection with
httpsCon = (HttpsURLConnection) url.openConnection();
It is already SSL/TLS encrypted without any more hassle?
How can I view and set the TLS version for the standard implementation? (Should be TLS 1.2 for Java 8 and TLS 1.0 for Java 7)
References
- Oracle Corp. (2011). javax.net.ssl.HttpsURLConnection. (JavaDoc)
https.protocols
system property, see this answer. – Whitcher