Usage in Deno
import * as mod from "node:tls";
The node:tls
module provides an implementation of the Transport Layer Security
(TLS) and Secure Socket Layer (SSL) protocols that is built on top of OpenSSL.
The module can be accessed using:
import tls from 'node:tls';
Accepts encrypted connections using TLS or SSL.
Performs transparent encryption of written data and all required TLS negotiation.
- addListener
- alpnProtocol
- authorizationError
- authorized
- disableRenegotiation
- emit
- enableTrace
- encrypted
- exportKeyingMaterial
- getCertificate
- getCipher
- getEphemeralKeyInfo
- getFinished
- getPeerCertificate
- getPeerFinished
- getPeerX509Certificate
- getProtocol
- getSession
- getSharedSigalgs
- getTLSTicket
- getX509Certificate
- isSessionReused
- on
- once
- prependListener
- prependOnceListener
- renegotiate
- setMaxSendFragment
Verifies the certificate cert
is issued to hostname
.
The callback
function, if specified, will be added as a listener for the 'secureConnect'
event.
[createServer](.././tls/~/createServer)
sets the default value of the honorCipherOrder
option
to true
, other APIs that create secure contexts leave it unset.
Creates a new Server. The secureConnectionListener
, if provided, is
automatically set as a listener for the 'secureConnection'
event.
Returns an array with the names of the supported TLS ciphers. The names are
lower-case for historical reasons, but must be uppercased to be used in
the ciphers
option of [createSecureContext](.././tls/~/createSecureContext)
.
The default value of the ciphers
option of createSecureContext()
.
It can be assigned any of the supported OpenSSL ciphers.
Defaults to the content of crypto.constants.defaultCoreCipherList
, unless
changed using CLI options using --tls-default-ciphers
.
The default curve name to use for ECDH key agreement in a tls server.
The default value is 'auto'
. See createSecureContext()
for further
information.
The default value of the maxVersion
option of createSecureContext()
.
It can be assigned any of the supported TLS protocol versions,
'TLSv1.3'
, 'TLSv1.2'
, 'TLSv1.1'
, or 'TLSv1'
. Default: 'TLSv1.3'
, unless
changed using CLI options. Using --tls-max-v1.2
sets the default to 'TLSv1.2'
. Using
--tls-max-v1.3
sets the default to 'TLSv1.3'
. If multiple of the options
are provided, the highest maximum is used.
The default value of the minVersion
option of createSecureContext()
.
It can be assigned any of the supported TLS protocol versions,
'TLSv1.3'
, 'TLSv1.2'
, 'TLSv1.1'
, or 'TLSv1'
. Default: 'TLSv1.2'
, unless
changed using CLI options. Using --tls-min-v1.0
sets the default to
'TLSv1'
. Using --tls-min-v1.1
sets the default to 'TLSv1.1'
. Using
--tls-min-v1.3
sets the default to 'TLSv1.3'
. If multiple of the options
are provided, the lowest minimum is used.
An immutable array of strings representing the root certificates (in PEM format) from the bundled Mozilla CA store as supplied by the current Node.js version.