Skip to content

Commit

Permalink
Update ovpn_revokeclient
Browse files Browse the repository at this point in the history
  • Loading branch information
lawtancool authored Jun 7, 2022
1 parent cd12942 commit 6a86b23
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions bin/ovpn_revokeclient
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,24 @@ if [ ! -f "$EASYRSA_PKI/private/${cn}.key" ]; then
fi

revoke_client_certificate(){
easyrsa revoke "$1"
# Download EasyRSA because Ubuntu doesn't have it as a CLI command
wget https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.6/EasyRSA-unix-v3.0.6.tgz
tar xvf EasyRSA-unix-v3.0.6.tgz

export EASYRSA="EasyRSA-v3.0.6/"
export EASYRSA_SSL_CONF="EasyRSA-v3.0.6/openssl-easyrsa.cnf"
cp -r EasyRSA-v3.0.6/x509-types/ x509-types/

EasyRSA-v3.0.6/easyrsa revoke "$1"
echo "Generating the Certificate Revocation List :"
easyrsa gen-crl
EasyRSA-v3.0.6/easyrsa gen-crl
cp -f "$EASYRSA_PKI/crl.pem" "$OPENVPN/crl.pem"
chmod 644 "$OPENVPN/crl.pem"

# Remove EasyRSA files when we're done
rm -r EasyRSA-v3.0.6/
rm EasyRSA-unix-v3.0.6.tgz
rm -r x509-types/
}

remove_files(){
Expand Down

0 comments on commit 6a86b23

Please sign in to comment.