See the API SSL_get_cipher_version() and friends.
Additionally, SSLv3/TLS packets all start with a header which you can easily inspect as well:
Byte 0 : Record Type
Byte 1 : Version Major
Byte 2 : Version Minor
Byte 3-4: Length of payload minus header (16k max)
Version Major breaks down like this:
Major == 2: SSLv2 (The rest differs from SSLv3+ headers)
Major == 3: SSLv3, TLSv1.0, TLSv1.1, or TLSv1.2
Version Minor:
Minor == 0: SSLv3
Minor == 1: TLSv1.0
Minor == 2: TLSv1.1
Minor == 3: TLSv1.2
Do note though that until the handshake/negotiation is complete, the versions used can change. If you wait until Application Data, it should be accurate. Example Application Data of a TLSv1.2 record:
0x17 0x03 0x03 ...
Sniff the Data!
Yet another approach if this is simply for research is to sniff the data with Wireshark or similar.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…