Creating a self-signed SSL certificate: Difference between revisions

From Notes to self
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
There are 2 possibilities: make a CA (Certificate Authority) and sign a server certificate with it or simply self-sign a server certificate.
*Without making a CA (Certificate Authority):
*Without making a CA (Certificate Authority):
**<code>$ openssl req -new -x509 -sha256 -newkey rsa:2048 -days 10000 -nodes -out server.crt -keyout server.key</code>
**<code>$ openssl req -new -x509 -sha256 -newkey rsa:2048 -days 10000 -nodes -out server.crt -keyout server.key</code>

Revision as of 19:53, 13 June 2015

There are 2 possibilities: make a CA (Certificate Authority) and sign a server certificate with it or simply self-sign a server certificate.

  • Without making a CA (Certificate Authority):
    • $ openssl req -new -x509 -sha256 -newkey rsa:2048 -days 10000 -nodes -out server.crt -keyout server.key
    • Set the Common Name (CN) to the FQDN and enter "." for everything else.
  • Creating a CA and sign a server certificate with it:
    • $ openssl req -new -x509 -sha256 -newkey rsa:2048 -days 10000 -nodes -out myCA.crt -keyout myCA.key
  • Put files server.crt and server.key to /etc/httpd/ (on Slackware) and set their permissions to 400.