Created
June 12, 2020 06:12
-
-
Save zthxxx/95d0323e1142eff45857092b20c74a45 to your computer and use it in GitHub Desktop.
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
function gen_ssl_cert { | |
local prefix="${1}" | |
openssl genrsa -des3 -out "${prefix}.lock.key" 1024 | |
openssl rsa -in "${prefix}.lock.key" -out "${prefix}.key" | |
rm "${prefix}.lock.key" | |
openssl req -new -key "${prefix}.key" -out "${prefix}.csr" | |
openssl x509 -req -days 3650 -in "${prefix}.csr" -signkey "${prefix}.key" -out "${prefix}.crt" | |
openssl pkcs12 -export -inkey "${prefix}.key" -in "${prefix}.crt" -out "${prefix}.pfx" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment