Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add variables to set expiration of CA certificate and client certificates #1060

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions openvpn-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@
# Secure OpenVPN server installer for Debian, Ubuntu, CentOS, Amazon Linux 2, Fedora, Oracle Linux 8, Arch Linux, Rocky Linux and AlmaLinux.
# https://github.com/angristan/openvpn-install

# Certificate expiration

# Default settings
# CA_EXPIRE=3650
# CERT_EXPIRE=825

CA_EXPIRE=3650
CERT_EXPIRE=3650

function isRoot() {
if [ "$EUID" -ne 0 ]; then
return 1
Expand Down Expand Up @@ -726,6 +735,8 @@ function installOpenVPN() {
echo "$SERVER_NAME" >SERVER_NAME_GENERATED

echo "set_var EASYRSA_REQ_CN $SERVER_CN" >>vars
echo "set_var EASYRSA_CA_EXPIRE $CA_EXPIRE" >>vars
echo "set_var EASYRSA_CERT_EXPIRE $CERT_EXPIRE" >>vars

# Create the PKI, set up the CA, the DH params and the server certificate
./easyrsa init-pki
Expand Down