tls.checkServerIdentity()

The Node.js function that checks whether a certificate is valid for a given host name, returning an Error if it is not.

In more detail

Node.js calls it automatically on client connections; you can call or replace it to add rules, such as pinning. It compares the host name with the certificate's Subject Alternative Names, including wildcard rules.

Related terms

Taught in

References