Availability::- use_module(library(ssl)).
(can be autoloaded)
[det]ssl_session(+Stream,
-Session)Retrieves (debugging) properties from the SSL context associated with Stream.
If Stream is not an SSL stream, the predicate raises a domain
error. Session is a list of properties, containing the
members described below. Except for Version, all information
are byte arrays that are represented as Prolog strings holding
characters in the range 0..255.
- ssl_version(Version)
- The negotiated version of the session as an integer.
- cipher(Cipher)
- The negotiated cipher for this connection.
- session_key(Key)
- The key material used in SSLv2 connections (if present).
- master_key(Key)
- The key material comprising the master secret. This is generated from
the server_random, client_random and pre-master key.
- client_random(Random)
- The random data selected by the client during handshaking.
- server_random(Random)
- The random data selected by the server during handshaking.
- session_id(SessionId)
- The SSLv3 session ID. Note that if ECDHE is being used (which is the
default for newer versions of OpenSSL), this data will not actually be
sent to the server.
- alpn_protocol(Protocol)
- The negotiated ALPN protocol, if supported. If no protocol was
negotiated, this will be an empty string.