Skip to main content

Interface: TlsOptions

TLS options for enabling HTTPS on the server.

Properties

alpn?

optional alpn?: string[]

ALPN protocol list to advertise during the TLS handshake, in preference order. When omitted, the server offers every enabled protocol (['h2', 'http/1.1']). Restrict it to require a particular protocol — e.g. ['h2'] to require HTTP/2, so a client that cannot speak h2 fails the ALPN handshake instead of falling back to HTTP/1.1.


ca?

optional ca?: string

CA certificate(s) in PEM format, for client certificate verification.


cert

cert: string

TLS certificate chain in PEM format.


key

key: string

TLS private key in PEM format.


passphrase?

optional passphrase?: string

Passphrase for an encrypted private key.


requestCert?

optional requestCert?: boolean

If true, the server requires a valid client certificate. Implies use of ca.