]> TLD Linux GIT Repositories - tld-builder.git/blob - admin/gen-cert.sh
- script for generating request handler server certificate
[tld-builder.git] / admin / gen-cert.sh
1 #!/bin/sh
2
3 umask 077
4
5 CONFIG=$HOME/.tldbuilderrc
6 [ -f "$CONFIG" ] && . $CONFIG
7 [ -n "$BUILDERPATH" ] || BUILDERPATH="$HOME/tld-builder/"
8 export BUILDERPATH
9
10 if [ -d "$BUILDERPATH" ]; then
11         cd "$BUILDERPATH"
12 else
13         echo "the $BUILDERPATH directory does not exist"
14         exit 1
15 fi
16
17
18 if [ -f "$BUILDERPATH/config/global" ]; then
19         . $BUILDERPATH/config/global
20 fi
21
22 echo "Generating self-signed certificate for request handler server"
23
24 openssl req -x509 -nodes -days 3650 \
25   -newkey rsa:4096 \
26   -keyout $BUILDERPATH/config/request-server.key \
27   -out $BUILDERPATH/config/request-server.crt \
28   <<EOF
29 .
30 .
31 .
32 TLD Linux
33 .
34 Build Request Server
35 admins@tld-linux.org
36 EOF
37
38 openssl x509 -in $BUILDERPATH/config/request-server.crt \
39   -noout -text -nameopt sep_multiline