Created
May 30, 2011 19:32
-
-
Save tomoconnor/999357 to your computer and use it in GitHub Desktop.
Create A Client Certificate
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
#!/bin/bash | |
# How To Create a client certificate | |
#As Root | |
cd /etc/ssl/myca | |
echo "Enter your username/tag!" | |
read USERNAME | |
echo "creating a CSR" | |
openssl req -config openssl.my.cnf -new -nodes -keyout private/${USERNAME}.key -out csr/${USERNAME}.csr -days 365 | |
echo "Sign the CSR, get a Certificate" | |
openssl ca -config openssl.my.cnf -policy policy_anything -out certs/${USERNAME}.crt -infiles csr/${USERNAME}.csr | |
echo "Export the Certificate as a format that browsers like" | |
openssl pkcs12 -export -in certs/${USERNAME}.crt -inkey private/${USERNAME}.key -out certs/${USERNAME}.p12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment