getProtocol

Returns a string containing the negotiated SSL/TLS protocol version of the current connection. The value 'unknown' will be returned for connected sockets that have not completed the handshaking process. The value null will be returned for server sockets or disconnected client sockets.

Protocol versions are:

  • 'SSLv3'

  • 'TLSv1'

  • 'TLSv1.1'

  • 'TLSv1.2'

  • 'TLSv1.3'

See the OpenSSL SSL_get_version documentation for more information.

Since

v5.7.0