Created
May 9, 2017 22:31
-
-
Save RichAyotte/7cc6951042b5130813bd79fb00f8388e to your computer and use it in GitHub Desktop.
Self signed cert on Linux for Chrome 58+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
openssl req \ | |
-newkey rsa:2048 \ | |
-x509 \ | |
-nodes \ | |
-keyout server.pem \ | |
-new \ | |
-out server.pem \ | |
-subj /CN=localhost \ | |
-reqexts SAN \ | |
-extensions SAN \ | |
-config <(cat /etc/ssl/openssl.cnf \ | |
<(printf '[SAN]\nsubjectAltName=DNS:localhost')) \ | |
-sha256 \ | |
-days 3650 | |
# Once installed, follow the in https://superuser.com/questions/1201552/not-a-certification-authority-while-importing-self-signed-certificate | |
# echo QUIT | openssl s_client -connect $DOMAIN_TO_FETCH_FROM:443 | sed -ne '/BEGIN CERT/,/END CERT/p' > my-cert | |
# certutil -d sql:$HOME/.pki/nssdb -A -t "P,," -n my-cert -i my-cert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment