Select Page

Here’s a quick script that will allow you to update your OpenVPN SSL Certificate, in case it expired. Please keep in mind to update the “SERVER” variable, to the actual server string that’s in your installation, located in the folder: /etc/openvpn/easy-rsa/pki/reqs/

!#/bin/bash -x
SERVER=server_Tan0QTKIV8puAS5G
echo ${SERVER}
cd /etc/openvpn/easy-rsa/
rm pki/reqs/${SERVER}.req
rm pki/private/${SERVER}.key
rm pki/issued/${SERVER}.crt
EASYRSA_CERT_EXPIRE=3650 ./easyrsa build-server-full ${SERVER} nopass
EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
cp pki/crl.pem /etc/openvpn
cp pki/issued/${SERVER}.crt /etc/openvpn
cp pki/private/${SERVER}.key /etc/openvpn/
systemctl restart [email protected]

Pin It on Pinterest