Skip to content

Instantly share code, notes, and snippets.

Last active Aug 2, 2019
What would you like to do?
OpenVPN Access Server w/ LetsEncrypt for Web UI
# Modified from
cert-name =
rsa-key-size = 4096
email =
domains =
agree-tos = True
# Would need to automate the process of adding a
# TXT record in Route53 for this to be automated:
manual = True
preferred-challenges = dns
# non-interactive True
# /usr/local/openvpn_as/scripts/ should be in the $PATH for these to work:
pre-hook = sacli Stop
post-hook = sacli Start
# Install dependencies
apt-get update
apt-get install software-properties-common
add-apt-repository ppa:certbot/certbot
apt-get install certbot
apt-get update
certbot certonly --config first_run.ini
# Update OpenVPN's db
/usr/local/openvpn_as/scripts/confdba -mk cs.ca_bundle -v "`cat /etc/letsencrypt/live/$DOMAIN/fullchain.pem`"
/usr/local/openvpn_as/scripts/confdba -mk cs.priv_key -v "`cat /etc/letsencrypt/live/$DOMAIN/privkey.pem`" > /dev/null
/usr/local/openvpn_as/scripts/confdba -mk cs.cert -v "`cat /etc/letsencrypt/live/$DOMAIN/cert.pem`"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment