createSelfSignedCertificate
createSelfSignedCertificate(
subjectAltNames?):Promise<SelfSignedCertificate>
Defined in: tls/create-self-signed-certificate.ts:28
Create a throwaway self-signed certificate for localhost and 127.0.0.1,
for a test that needs a TLS server. Trust it explicitly on the client side
(ca: cert); nothing is installed anywhere.
Uses the openssl command, which must be on the PATH, with an ECDSA P-256
key valid for one day. Takes tens of milliseconds: create one per suite.
Parameters
Section titled “Parameters”subjectAltNames?
Section titled “subjectAltNames?”readonly string[] = ...
The names the certificate is valid for, in OpenSSL’s
subjectAltName syntax. Defaults to localhost and 127.0.0.1; a test of
name verification passes others.
Returns
Section titled “Returns”Promise<SelfSignedCertificate>
Throws
Section titled “Throws”When openssl is missing or fails.