Last active
March 16, 2025 21:14
-
-
Save riy/fd387bb452b19f0ec4ba to your computer and use it in GitHub Desktop.
Revisions
-
riy renamed this gist
Mar 16, 2025 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
riy revised this gist
Jan 16, 2016 . No changes.There are no files selected for viewing
-
riy renamed this gist
Jan 15, 2016 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
astropanic created this gist
Jan 14, 2016 .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,18 @@ #!/bin/bash HOST_IP=`ifconfig eth0| awk '/inet addr/{print substr($2,6)}'` mkdir docker-ca chmod 0700 docker-ca cd docker-ca openssl genrsa -aes256 -out ca-key.pem 2048 openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem openssl genrsa -out server-key.pem 2048 openssl req -subj "/CN=${HOST_IP}" -new -key server-key.pem -out server.csr echo subjectAltName = IP:${HOST_IP},IP:127.0.0.1 > extfile.cnf openssl x509 -req -days 365 -in server.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out server-cert.pem -extfile extfile.cnf openssl genrsa -out client-key.pem 2048 openssl req -subj '/CN=client' -new -key client-key.pem -out client.csr echo extendedKeyUsage = clientAuth > extfile.cnf openssl x509 -req -days 365 -in client.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -out client-cert.pem -extfile extfile.cnf chmod -v 0400 ca-key.pem client-key.pem server-key.pem chmod -v 0444 ca.pem server-cert.pem client-cert.pem