svn cleanup
[anytun.git] / openvpn / easy-rsa / build-key-server
blob30dc41e364eaa385f1a8fc5f5d26111fa30453c2
1 #!/bin/sh
4 # Make a certificate/private key pair using a locally generated
5 # root certificate.
7 # Explicitly set nsCertType to server using the "server"
8 # extension in the openssl.cnf file.
10 if test $# -ne 1; then
11 echo "usage: build-key-server <name>";
12 exit 1
13 fi
15 if test $KEY_DIR; then
16 cd $KEY_DIR && \
17 openssl req -days 3650 -nodes -new -keyout $1.key -out $1.csr -extensions server -config $KEY_CONFIG && \
18 openssl ca -days 3650 -out $1.crt -in $1.csr -extensions server -config $KEY_CONFIG && \
19 chmod 0600 $1.key
20 else
21 echo you must define KEY_DIR