Search code examples
javajsse

How do I get master key in ssl session in java?


I have a sslscoket as server in my application and I am running java 1.6. I need the master secret key used during handshake to implement the MS-CHAP challenge response and so on. I have read that "The value of this master secret is known only to the underlying secure socket implementation and is not exposed through the SSLSession API"

How can I get the value of the master secret?

Thanks


Solution

  • After a while I have managed to get the master secret used in the TLS hanshake. It is possible to get it using reflection and SSLSessionImpl.class