3 CERT=/var/lib/openssl/certs/apache.pem
4 export RANDFILE=/dev/random
6 if [ "$1" != "--force" -a -f $CERT ]; then
7 echo "$CERT exists! Use \"$0 --force.\""
11 if [ "$1" == "--force" ]; then
16 echo creating selfsingned certificate
17 echo "replace it with one signed by a certification authority (CA)"
19 echo enter your ServerName at the Common Name prompt
21 echo If you want your certificate to expire after x days call this programm
22 echo with "-days x". Default: 30 days
24 # use special .cnf, because with normal one no valid selfsigned
25 # certificate is created
27 openssl req $@ -config /etc/openssl/openssl.cnf \
28 -new -x509 -nodes -out $CERT -keyout $CERT
33 /var/lib/openssl/`/usr/bin/openssl x509 -noout -hash < $CERT`.0