I am developing a java agent to monitor http communications happening in my application server. I like to know the SSL version(SSLv3, TLS, etc) used in outgoing Https connections. Is there a way to get the SSL version by any means?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
I used this solution, maybe it can help you:
First you need an extension class of
SSLSocketFactory
to attach aHandshakeCompletedListener
to the sockets created by theSSLSocketFactory
: (inspired by How to override the cipherlist sent to the server by Android when using HttpsURLConnection?)Then you need an implementation of the
HandshakeCompletedListener
interface. You must implement thehandshakeCompleted
method:In
handshakeCompleted
you can get the protocol version (maybe TLSv1.2), and by the way also the information on cipher suite etc., that is also accessible viaHttpsConnection
. You can set the custom SSL socket factory viaconn.setSSLSocketFactory
before connect: