Created
February 24, 2019 17:51
-
-
Save JoshData/49eff618f84ce4890697d65bcb740137 to your computer and use it in GitHub Desktop.
self-signed TLS/SSL certificate one-liner bash script
This file contains 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
mkdir -p /etc/ssl/local \ | |
&& (umask 077; openssl genrsa -out /etc/ssl/local/ssl_certificate.key 2048) \ | |
&& openssl req -new -key /etc/ssl/local/ssl_certificate.key -out temp.csr -sha256 -subj "/CN=$HOSTNAME" \ | |
&& openssl x509 -req -days 365 -in temp.csr -signkey /etc/ssl/local/ssl_certificate.key -out /etc/ssl/local/ssl_certificate.crt \ | |
&& rm -f temp.csr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment