Last active
November 27, 2018 15:30
-
-
Save zmax/1534771b9f52b1365ded354bb3beff37 to your computer and use it in GitHub Desktop.
Revisions
-
zmax revised this gist
Nov 27, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,8 @@ HOST=${1} mkdir -p ~/.ssl # generate cert and key openssl req -newkey rsa:2048 -x509 -nodes -keyout ~/.ssl/$HOST.key -new -out ~/.ssl/$HOST.crt -subj /CN=$HOST -reqexts SAN -extensions SAN -config <(cat /System/Library/OpenSSL/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:${HOST}")) -sha256 -days 3650 # add to keychains -
zmax created this gist
Nov 27, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ #!/bin/bash HOST=${1} # generate cert and key openssl req -newkey rsa:2048 -x509 -nodes -keyout ~/.ssl/$HOST.key -new -out ~/.ssl/$HOST.crt -subj /CN=$HOST -reqexts SAN -extensions SAN -config <(cat /System/Library/OpenSSL/openssl.cnf <(printf "[SAN]\nsubjectAltName=DNS:${HOST}")) -sha256 -days 3650 # add to keychains sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.ssl/${HOST}.crt