Skip to main content
TLSSocket.prototype.getProtocol - tls - Node documentation
method TLSSocket.prototype.getProtocol

Usage in Deno

import { TLSSocket } from "node:tls";
TLSSocket.prototype.getProtocol(): string | null

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.

Return Type

string | null
Back to top