OpenSSL Generating a Certificate Signing Request: Difference between revisions
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
# For Apache purposes, use the key with no pass phrase to generate the CSR file. | # 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. | # Create a config file to be configured with the multiple subdomains. | ||
#: <tt>'''cat << EOL >> <config_file>.cnf'''</tt> | #: <tt>'''# cat << EOL >> <config_file>.cnf'''</tt> | ||
#:<tt>'''[ req ]'''</tt> | |||
#:<tt>'''default_bits = 2048'''</tt> | |||
#:<tt>'''default_keyfile = san.key #name of the keyfile'''</tt> | |||
#:<tt>'''distinguished_name = req_distinguished_name'''</tt> | |||
#:<tt>'''req_extensions = req_ext'''</tt> | |||
#:<tt>''''''</tt> | |||
#:<tt>'''[ req_distinguished_name ]'''</tt> | |||
#:<tt>'''countryName = Country Name (2 letter code)'''</tt> | |||
#:<tt>'''countryName_default = GB'''</tt> | |||
#:<tt>'''stateOrProvinceName = State or Province Name (full name)'''</tt> | |||
#:<tt>'''stateOrProvinceName_default = West Midlands'''</tt> | |||
#:<tt>'''localityName = Locality Name (eg, city)'''</tt> | |||
#:<tt>'''localityName_default = Birmingham'''</tt> | |||
#:<tt>'''organizationName = Organization Name (eg, company)'''</tt> | |||
#:<tt>'''organizationName_default = Example'''</tt> | |||
#:<tt>'''commonName = Common Name (e.g. server FQDN or YOUR name)'''</tt> | |||
#:<tt>'''commonName_max = 64'''</tt> | |||
#:<tt>''''''</tt> | |||
#:<tt>'''[ req_ext ]'''</tt> | |||
#:<tt>'''subjectAltName = @alt_names'''</tt> | |||
#:<tt>''''''</tt> | |||
#:<tt>'''[alt_names]'''</tt> | |||
#:<tt>'''DNS.1 = www.example.com'''</tt> | |||
#:<tt>'''DNS.2 = www.example.net'''</tt> | |||
#:<tt>'''DNS.3 = www.example.org'''</tt> | |||
#:<tt>'''EOL'''</tt> | |||
# Generate the CSR from the private key using openssl. | # Generate the CSR from the private key using openssl. | ||
#: <tt>'''# openssl req -new -key <key_name>.key -out <csr_name>.csr'''</tt> | #: <tt>'''# openssl req -new -key <key_name>.key -out <csr_name>.csr'''</tt> |
Revision as of 03:53, 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 = san.key #name of the keyfile
- 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 = West Midlands
- localityName = Locality Name (eg, city)
- localityName_default = Birmingham
- 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 = www.example.com
- DNS.2 = www.example.net
- DNS.3 = www.example.org
- 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