OpenSSL Generating a Certificate Signing Request: Difference between revisions
Jump to navigation
Jump to search
Line 18: | Line 18: | ||
distinguished_name = req_distinguished_name | distinguished_name = req_distinguished_name | ||
req_extensions = req_ext | req_extensions = req_ext | ||
[ req_distinguished_name ] | [ req_distinguished_name ] | ||
countryName = Country Name (2 letter code) | countryName = Country Name (2 letter code) | ||
Line 30: | Line 30: | ||
commonName = Common Name (e.g. server FQDN or YOUR name) | commonName = Common Name (e.g. server FQDN or YOUR name) | ||
commonName_max = 64 | commonName_max = 64 | ||
[ req_ext ] | [ req_ext ] | ||
subjectAltName = @alt_names | subjectAltName = @alt_names | ||
[alt_names] | [alt_names] | ||
DNS.1 = <domain>.com | DNS.1 = <domain>.com |
Revision as of 04:04, 15 November 2020
Generate the Certificate Signing Request (CSR)
Apache with mod_ssl Enabled (No subjectAltName)
- If required follow the OpenSSL Generating a Private Key procedure.
- For Apache purposes, use the key with no pass phrase to generate the CSR file.
- Generate the CSR from the private key using openssl.
- # openssl req -new -key <key_name>.key -out <csr_name>.csr
- Enter the information as required by the prompts.
- Verify the checksum of the key matches the checksum CSR.
- # openssl req -noout -modulus -in <csr_name>.csr | openssl md5
Apache with mod_ssl Enabled (With subjectAltName)
- If required follow the OpenSSL Generating a Private Key procedure.
- For Apache purposes, use the key with no pass phrase to generate the CSR file.
- Create a config file to be configured with the multiple subdomains.
- # cat << EOL >> <config_file>.cnf
[ req ] default_bits = 2048 default_keyfile = <private_key>.key distinguished_name = req_distinguished_name req_extensions = req_ext [ req_distinguished_name ] countryName = Country Name (2 letter code) countryName_default = US stateOrProvinceName = State or Province Name (full name) stateOrProvinceName_default = New York localityName = Locality Name (eg, city) localityName_default = New York organizationName = Organization Name (eg, company) organizationName_default = Example commonName = Common Name (e.g. server FQDN or YOUR name) commonName_max = 64 [ req_ext ] subjectAltName = @alt_names [alt_names] DNS.1 = <domain>.com DNS.2 = www.<domain>.com DNS.3 = *.<domain>.com EOL
- Generate the CSR from the private key using openssl.
- # openssl req -new -key <key_name>.key -out <csr_name>.csr
- Enter the information as required by the prompts.
- Verify the checksum of the key matches the checksum CSR.
- # openssl req -noout -modulus -in <csr_name>.csr | openssl md5