Skip to content

Instantly share code, notes, and snippets.

@epcim
Last active March 28, 2024 07:00
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save epcim/232c2ecae527f133fb40 to your computer and use it in GitHub Desktop.
Save epcim/232c2ecae527f133fb40 to your computer and use it in GitHub Desktop.
openvpn easy-rsa certs (+revoke)

easy-rsa 3.x

https://github.com/OpenVPN/easy-rsa/tree/master/doc

Init:

  wget https://github.com/OpenVPN/easy-rsa/releases/download/3.0.1/EasyRSA-3.0.1.tgz
  tar xzvf EasyRSA-3.0.1.tgz
  cd EasyRSA-3*
  vim vars # var.example
  ./easyrsa init-pki
  ./easyrsa build-ca

Revoke

  . vars
  ./easyrsa revoke NAME
  ./easyrsa gen-crl
  
  cp $KEY_DIR/crl.pem ..
  vim /etc/openvpn/server.conf #add: crl-verify /etc/openvpn/crl.pem
  /etc/init.d/openvpn reload

easy-rsa 2.0

http://blog.remibergsma.com/2013/02/27/improving-openvpn-security-by-revoking-unneeded-certificates/

Init: #TODO

  . vars
  ./build-ca (or pkitool)

Revoke:

  cd /etc/openvpn/easy-rsa/
  wget https://raw.githubusercontent.com/OpenVPN/easy-rsa-old/master/easy-rsa/2.0/revoke-full
  chmod u+x revoke-full
  
  . vars
  ./revoke-full NAME
  
  cp $KEY_DIR/crl.pem ..
  vim /etc/openvpn/server.conf #add: crl-verify /etc/openvpn/crl.pem
  /etc/init.d/openvpn reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment