Technotes

Technotes for future me

SAN Certificates

Create a file named ssl.cnf using vi with the following information

############
[ req ]
default_bits       = 4096
distinguished_name = req_distinguished_name
req_extensions     = req_ext

[ req_distinguished_name ]
countryName                 = Country Name (2 letter code)
countryName_default         = GB
stateOrProvinceName         = State or Province Name (full name)
stateOrProvinceName_default = England
localityName                = Locality Name (eg, city)
localityName_default        = Brighton
organizationName            = Organization Name (eg, company)
organizationName_default    = Blaataap
commonName                  = Common Name (e.g. server FQDN or YOUR name)
commonName_max              = 64
commonName_default          = localhost


[ req_ext ]
subjectAltName = @alt_names

[alt_names]
DNS.1   = name1.blaataap.com
DNS.2   = name2.blaataap.com
DNS.3   = name3.blaataap.com

Create key

openssl genrsa -out name1.blaataap.com.key 4096

Create new csr

openssl req -sha256 -new -key name1.blaataap.com.key -out name1.blaataap.com.csr -config ssl.cnf

Show csr

openssl req -noout -modulus -text -in name1.blaataap.csr

Match csr with key

openssl req -noout -modulus -in  name1.blaataap.csr | openssl md5;openssl rsa -noout -modulus -in name1.blaataap.key | openssl md5
Last updated on 19 May 2021
Published on 22 Oct 2020
Edit on GitHub