Last active
August 14, 2018 12:00
-
-
Save virtualLast/d7956e5e4a94d06ddd133f15fc97a4dc to your computer and use it in GitHub Desktop.
Create a self signed openSSL certificate for macOS
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
#server.key can be named anything you like, remember to update the .conf files accordingly | |
1 ) openssl genrsa -des3 -out server.key 2048 | |
#update localhost to whatever dynamic dns you have set up, or use IP:127.0.0.1 | |
2 ) openssl req \ | |
-newkey rsa:2048 \ | |
-x509 \ | |
-nodes \ | |
-keyout server.key \ | |
-new \ | |
-out server.crt \ | |
-subj /CN=localhost \ | |
-reqexts SAN \ | |
-extensions SAN \ | |
-config <(cat /System/Library/OpenSSL/openssl.cnf \ | |
<(printf '[SAN]\nsubjectAltName=DNS:localhost')) \ | |
-sha256 \ | |
-days 3650 | |
3 ) cp server.key server.tmp | |
4 ) openssl rsa -in server.tmp -out server.key | |
5 ) cp server.crt /Applications/MAMP/conf/apache | |
6 ) cp server.key /Applications/MAMP/conf/apache |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment