Created
December 23, 2009 11:01
-
-
Save scottwb/262466 to your computer and use it in GitHub Desktop.
Create .pem 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/sh | |
# | |
# Script to create an SSL .pem certificate. | |
# | |
# Adapted from Fedora's /etc/pki/tls/certs/Makefile. Only tested on | |
# Mac OS X 10.5. | |
# | |
PEMFILE=$1 | |
umask 77 | |
PEM1=`mktemp $TMPDIR/openssl.XXXXXX` | |
PEM2=`mktemp $TMPDIR/openssl.XXXXXX` | |
openssl req -newkey rsa:1024 -keyout $PEM1 -nodes -x509 -days 365 -out $PEM2 -set_serial 0 | |
cat $PEM1 > $PEMFILE | |
echo "" >> $PEMFILE | |
cat $PEM2 >> $PEMFILE | |
rm $PEM1 $PEM2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment