Skip to content

Interface: TlsOptions ​

Defined in: netconf/src/transport/tls.ts:38

Options for tls: the server, our client certificate, and how to verify the server (ca, fingerprint, or both). See TLS.

Properties ​

ca? ​

ts
readonly ca?: 
  | Pem
  | readonly Pem[];

Defined in: netconf/src/transport/tls.ts:57

Trust anchors for the server's certificate. The chain must lead to one of them, and the certificate must name serverName (default host) as a DNS name or IP address (RFC 6125).


cert ​

ts
readonly cert: Secret<Pem>;

Defined in: netconf/src/transport/tls.ts:47

Our certificate (PEM), optionally followed by its intermediate CAs. Required: RFC 7589 is mutual TLS.


ciphers? ​

ts
readonly ciphers?: string;

Defined in: netconf/src/transport/tls.ts:83

OpenSSL cipher list, replacing DEFAULT_TLS_CIPHERS (TLS 1.3 suites, then TLS 1.2 ECDHE with AES-GCM or ChaCha20-Poly1305 only, per RFC 9325). Widen it only for a server that can't do better.


fingerprint? ​

ts
readonly fingerprint?: string | readonly string[];

Defined in: netconf/src/transport/tls.ts:64

Pin the server's certificate by SHA-256 fingerprint: SHA256: + base64 (as for SSH), or hex with or without colons (as openssl x509 -fingerprint -sha256 prints). With ca as well, the chain, the name and the pin must all pass; alone, the pin is the server's whole identity.


host ​

ts
readonly host: string;

Defined in: netconf/src/transport/tls.ts:43

The host name or address to connect to. With ca, it is also the name the server certificate must carry, unless serverName is given.


insecure? ​

ts
readonly insecure?: "insecure-accept-any";

Defined in: netconf/src/transport/tls.ts:75

'insecure-accept-any' turns off server certificate verification: any certificate is accepted, so nothing proves you reached the server you meant to, and anyone who can intercept the connection can read and change the session. Each connection logs a warning to this transport's logger, if one is given. Only for a lab. Can't be combined with ca or fingerprint.


keepalive? ​

ts
readonly keepalive?: number;

Defined in: netconf/src/transport/tls.ts:85

Milliseconds of idle before TCP keepalive probes start. Default 30 000; 0 disables. Ignored with sock.


key ​

ts
readonly key: Secret<Pem>;

Defined in: netconf/src/transport/tls.ts:49

The private key for cert (PEM).


logger? ​

ts
readonly logger?: Logger;

Defined in: netconf/src/transport/tls.ts:87

Where the transport logs, such as a warning that verification is off. Separate from connect({ logger }).


passphrase? ​

ts
readonly passphrase?: Secret<string>;

Defined in: netconf/src/transport/tls.ts:51

The passphrase that decrypts key.


port? ​

ts
readonly port?: number;

Defined in: netconf/src/transport/tls.ts:45

Default 6513, the IANA port for NETCONF over TLS.


serverName? ​

ts
readonly serverName?: string;

Defined in: netconf/src/transport/tls.ts:66

The name to check the server certificate against, if not host. Sent as SNI unless it is an IP address.


sock? ​

ts
readonly sock?: Duplex;

Defined in: netconf/src/transport/tls.ts:77

An already-connected socket to run TLS over, as in call home (RFC 8071) or through a tunnel.

Released under the MIT Licence.