Certificates in Linux
Created: 2019-12-05 22:32:53 | Last modified: 2024-10-06 20:00:52
Access: Read | Views: 130 | Rating: N/A | Tags: pfx certificates
List of commands to create certificates in Linux / Windows
To generate an SSL certificate
openssl req -newkey rsa:2048 -nodes -keyout cert.key -out cert.csr
Then go through and answer the following questions and answer per the highlighted sections
#Enter in the following details
Country Name (2 letter code) [XX]:NZ
State or Province Name (full name) []:Your City
Locality Name (eg, city) [Default City]:Your City
Organization Name (eg, company) [Default Company Ltd]:You Company
Organizational Unit Name (eg, section) []:Sub Company
Common Name (eg, your name or your server's hostname) []:server.domain.com
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
To create a PFX
A PFX is a certificate which can be imported into Windows/IIS. To create this using openssl and Linux, run the following command
certificate.pfx: output of the command
privatekey.key: the certificate key file
certificate.crt: the actual certificate
Intermediate.crt: any intermediate certificates required
openssl pkcs12 -export -out certificate.pfx -inkey privatekey.key -in certificate.crt -certfile intermediate.crt
To test/debug an SSL cert, you can use the following command
openssl s_client -connect www.domain.com:443