I've got the following lines of code to set up an SSL connection:
HttpsURLConnection con = (HttpsURLConnection) new URL(url).openConnection();
I use the given connection to send a message and retrieve a response. Now I've gotten the question: Which security technique is used in this connection? I'd like to know if the connection is, for example, TLS1.2. How can I retrieve this using Java?