2
0
openvpn-ldap-testbed/vpnca.sh

23 lines
517 B
Bash
Raw Permalink Normal View History

2023-10-04 00:36:16 +02:00
#!/bin/sh
set -e
cd "$(dirname "$(readlink -f "$0")")"
test -f vpnca/pki/ca.crt && {
echo "ERROR: vpnca/pki/ca.crt already exists; aborting (to build a new CA, completely remove ./vpnca)." >&2 ;
exit 1 ;
}
make-cadir vpnca
{
cd vpnca ;
export EASYRSA_BATCH=true ;
./easyrsa init-pki ;
./easyrsa gen-dh ;
./easyrsa --req-cn="VPN Test Root CA" build-ca nopass ;
./easyrsa build-server-full server.example.test nopass ;
./easyrsa build-client-full client.example.test nopass ;
}