NodeJS Self Signed Certs

Posted on: 5/30/2023 Last Updated: 5/31/2023
Just some notes on generating SSL certs
All Articles

SSL Cert Stuff

Just some stuff around generating SSL certs to play with.

## NodeJS Self Signed Certs

cert.conf

# Update the defaults to what you want, then use this as your template to generate a SSL cert

[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req

[req_distinguished_name]
countryName = Country Name (2 letter code)
countryName_default = CA
stateOrProvinceName = State or Province Name (full name)
stateOrProvinceName_default = Alberta
localityName = Locality Name (eg, city)
localityName_default = Your City
organizationName = Organization Name (eg, company) [Internet Widgits Pty Ltd]
organizationName_default = Your Company Name Here
organizationalUnitName  = Organizational Unit Name (eg, section)
organizationalUnitName_default  = Engineering
commonName = yourdomain.com
commonName_default = your_domain_here.com
commonName_max  = 64

[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names

[alt_names]
DNS.1 = server1.com
DNS.2 = server2.com


# This is a 1 year cert (356 days)
openssl req -newkey rsa:2048 -new -config cert.conf -nodes -x509 -days 365 -keyout key.pem -out cert.pem

NodeJS HTTPS Server

coming soon...

Tags:
server code tutorial mop