Skip to content

Instantly share code, notes, and snippets.

@mehrdad-shokri
Last active April 8, 2018 02:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mehrdad-shokri/dbe4624770e10d22cd9b8747773276f6 to your computer and use it in GitHub Desktop.
Save mehrdad-shokri/dbe4624770e10d22cd9b8747773276f6 to your computer and use it in GitHub Desktop.
useful links for openssl self signed certificates
openssl genrsa -out key.pem 2048
# OR
openssl genrsa -des3 -out rootCA.key 2048
1:
openssl req -new -key key.pem -out csr.csr \
-reqexts v3_req \
-extensions v3_req \
-config <(cat /usr/lib/ssl/openssl.cnf \
<(cat ./openssl.cnf)) \
-sha256 \
-days 3650
2:
openssl req \
-newkey rsa:2048 \
-x509 \
-nodes \
-keyout server.pem \
-new \
-out server.pem \
-subj /CN=localhost \
-reqexts SAN \
-extensions SAN \
-config openssl.cnf
-sha256 \
-days 3650
openssl x509 -in cert.pem -inform PEM -out cert.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment