What version of TLS are we on?

How to check TLS version HTTPS?

I have a web application in AWS which has an API exposed through HTTPS.

This API works fine when the client has an SSL certificate but fails with "An error occurred during a connection to xxx.xxx:443" when the client does not have an SSL certificate. The exception thrown is "Error occurred during WebSocket handshake: Unexpected response code: 1011".

I am using Java and the Apache HTTP client version 4. I am able to connect to the API with a client with an SSL certificate, but the same client with no SSL certificate throws the exception I mentioned. How can I find out the version of TLS that is being used in the HTTPS connection? You can use the following code: HttpURLConnection con = (HttpURLConnection) new URL("").openConnection(); int responseCode = con.getResponseCode(); System.println(con.getResponseMessage());
Con.disconnect(); System.println(con.getResponseMessage());
If the response code is 4xx then it's HTTP level error, if the response code is 5xx then it's server side error.

Related Answers

What is TLS?

TLS is the standard protocol for securing network communication. I...

Which is more secure SSL TLS or HTTPS?

and SSL? I know the difference between TCP/IP vs. IP, or S...

What is TLS/SSL Protocol?

TLS stands for Transport Layer Security and it is a protocol used to create a secure connect...