]> git.pld-linux.org Git - packages/openssl.git/blame - openssl-ssl-certificate.sh
up to 3.3.0 (fixes CVE-2024-2511)
[packages/openssl.git] / openssl-ssl-certificate.sh
CommitLineData
15ceaa80
PG
1#!/bin/sh -e
2
db05d2e5 3CERT=/etc/openssl/certs/apache.pem
15ceaa80
PG
4export RANDFILE=/dev/random
5
6if [ "$1" != "--force" -a -f $CERT ]; then
7 echo "$CERT exists! Use \"$0 --force.\""
8 exit 0
9fi
10
96dc38ee 11if [ "$1" = "--force" ]; then
15ceaa80
PG
12 shift
13fi
14
15echo
16echo creating selfsingned certificate
17echo "replace it with one signed by a certification authority (CA)"
18echo
19echo enter your ServerName at the Common Name prompt
20echo
21echo If you want your certificate to expire after x days call this programm
a4271e4c 22echo with "-days x". Default: 30 days
15ceaa80
PG
23
24# use special .cnf, because with normal one no valid selfsigned
25# certificate is created
26
27openssl req $@ -config /etc/openssl/openssl.cnf \
28 -new -x509 -nodes -out $CERT -keyout $CERT
29
30chmod 600 $CERT
31
32ln -sf $CERT \
db05d2e5 33 /etc/openssl/certs/`/usr/bin/openssl x509 -noout -hash < $CERT`.0
This page took 0.248338 seconds and 4 git commands to generate.