Monday, 27 January 2020

Generating test self-signed certificate with domain for web servers

To generate a self-signed SSL certificate using the OpenSSL, complete the following steps:
  1. Run the following OpenSSL command to generate your private key and public certificate. Answer the questions and enter the Common Name when prompted.
    openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
    
  2. Review the created certificate:
    openssl x509 -text -noout -in certificate.pem
    
  3. Combine your key and certificate in a PFX bundle:
     openssl pkcs12 -inkey key.pem -in certificate.pem -export -out certificate.pfx
    
  4. Validate your P2 file.
    openssl pkcs12 -in certificate.p12 -noout -info

No comments:

Post a Comment