Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CreateServerOptions

Hierarchy

  • CreateServerOptions

Index

Properties

Optional ALPNProtocols

ALPNProtocols: string[] | Buffer

An array of strings or a Buffer naming possible ALPN protocols. (Protocols should be ordered by their priority.) When the server receives both NPN and ALPN extensions from the client, ALPN takes precedence over NPN and the server does not send an NPN extension to the client.

Optional NPNProtocols

NPNProtocols: string[] | Buffer

An array of strings or a Buffer naming possible NPN protocols. (Protocols should be ordered by their priority.)

Optional SNICallback

SNICallback: function

A function that will be called if the client supports SNI TLS extension. Two arguments will be passed when called: servername and cb. SNICallback should invoke cb(null, ctx), where ctx is a SecureContext instance. (tls.createSecureContext(...) can be used to get a proper SecureContext.) If SNICallback wasn't provided the default callback with high-level API will be used (see below).

Type declaration

    • (servername: string, cb: function): void
    • Parameters

      • servername: string
      • cb: function

      Returns void

Optional ca

ca: string | Buffer | string[] | Buffer[]

A string, Buffer, array of strings, or array of Buffers of trusted certificates in PEM format. If omitted, several well known "root" CAs (like VeriSign) will be used. These are used to authorize connections.

Optional cert

cert: string | Buffer | string[] | Buffer[]

A string containing the PEM encoded certificate.

Optional ciphers

ciphers: string

A string describing the ciphers to use or exclude, separated by :.

Optional crl

crl: string | string[]

Either a string or array of strings of PEM encoded CRLs (Certificate Revocation List).

Optional dhparam

dhparam: string | Buffer

A string or Buffer containing Diffie Hellman parameters, required for Perfect Forward Secrecy. Use openssl dhparam to create the parameters. The key length must be greater than or equal to 1024 bits, otherwise an error will be thrown. It is strongly recommended to use 2048 bits or larger for stronger security. If omitted or invalid, the parameters are silently discarded and DHE ciphers will not be available.

Optional ecdhCurve

ecdhCurve: string

A string describing a named curve to use for ECDH key agreement or false to disable ECDH. Defaults to prime256v1 (NIST P-256). Use crypto.getCurves() to obtain a list of available curve names. On recent releases, openssl ecparam -list_curves will also display the name and description of each available elliptic curve.

Optional handshakeTimeout

handshakeTimeout: number

Abort the connection if the SSL/TLS handshake does not finish in the specified number of milliseconds. Defaults to 120 seconds. A 'clientError' is emitted on the tls.Server object whenever a handshake times out.

Optional honorCipherOrder

honorCipherOrder: boolean

When choosing a cipher, use the server's preferences instead of the client preferences. Defaults to true.

Optional key

key: string | string[] | Buffer | Array<object>

The private key of the server in PEM format. To support multiple keys using different algorithms an array can be provided either as a plain array of key strings or an array of objects in the format {pem: key, passphrase: passphrase}. This option is required for ciphers that make use of private keys.

Optional passphrase

passphrase: string

A string containing the passphrase for the private key or pfx.

Optional pfx

pfx: string | Buffer

A string or Buffer containing the private key, certificate and CA certs of the server in PFX or PKCS12 format. (Mutually exclusive with the key, cert, and ca options.)

Optional rejectUnauthorized

rejectUnauthorized: boolean

If true the server will reject any connection which is not authorized with the list of supplied CAs. This option only has an effect if requestCert is true. Defaults to false.

Optional requestCert

requestCert: boolean

If true the server will request a certificate from clients that connect and attempt to verify that certificate. Defaults to false.

Optional secureProtocol

secureProtocol: string

The SSL method to use, e.g., SSLv3_method to force SSL version 3. The possible values depend on the version of OpenSSL installed in the environment and are defined in the constant SSL_METHODS.

Optional sessionIdContext

sessionIdContext: string

A string containing an opaque identifier for session resumption. If requestCert is true, the default is a 128 bit truncated SHA1 hash value generated from the command-line. Otherwise, a default is not provided.

Optional sessionTimeout

sessionTimeout: number

An integer specifying the number of seconds after which the TLS session identifiers and TLS session tickets created by the server will time out. See SSL_CTX_set_timeout for more details.

Optional ticketKeys

ticketKeys: Buffer

A 48-byte Buffer instance consisting of a 16-byte prefix, a 16-byte HMAC key, and a 16-byte AES key. This can be used to accept TLS session tickets on multiple instances of the TLS server. Note that this is automatically shared between cluster module workers.

Generated using TypeDoc