2

To understand better the TLS mechanism. I would like to get what is the ciphersuite my server and each of its clients agreed to use after the handshake. However, I cannot find any methods or any information on the web to do this.

I have I Java server and access to the SSLSockets.

How would you suggest to do it?

Thanks,

jay.end
  • 69
  • 1
  • 10

1 Answers1

6

This is more or less the same as this question, but for the cipher suite: use getSession() on your SSLSocket (or SSLEngine) to get the current SSLSession, then use getCipherSuite().

(Note that getSession() will have the side effect of initiating a handshake if this hasn't already been done another way, see introduction of SSLSocket documentation).

Community
  • 1
  • 1
Bruno
  • 119,590
  • 31
  • 270
  • 376