3
if [ "$1" != "--force" -a -f /etc/apache2/ssl/apache.pem ]; then
4
echo "/etc/apache2/ssl/apache.pem exists! Use \"$0 --force.\""
8
if [ "$1" = "--force" ]; then
13
echo creating selfsigned certificate
14
echo "replace it with one signed by a certification authority (CA)"
16
echo enter your ServerName at the Common Name prompt
18
echo If you want your certificate to expire after x days call this programm
21
# use special .cnf, because with normal one no valid selfsigned
22
# certificate is created
24
export RANDFILE=/dev/random
25
openssl req $@ -config /usr/share/apache2/ssleay.cnf \
26
-new -x509 -nodes -out /etc/apache2/ssl/apache.pem \
27
-keyout /etc/apache2/ssl/apache.pem
28
chmod 600 /etc/apache2/ssl/apache.pem
29
ln -sf /etc/apache2/ssl/apache.pem \
30
/etc/apache2/ssl/`/usr/bin/openssl \
31
x509 -noout -hash < /etc/apache2/ssl/apache.pem`.0