File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ ENV EASYRSA /usr/share/easy-rsa
17
17
ENV EASYRSA_PKI $OPENVPN/pki
18
18
ENV EASYRSA_VARS_FILE $OPENVPN/vars
19
19
20
+ # Prevents refused client connection because of an expired CRL
21
+ ENV EASYRSA_CRL_DAYS 3650
22
+
20
23
VOLUME ["/etc/openvpn" ]
21
24
22
25
# Internally uses port 1194/udp, remap using `docker run -p 443:1194/tcp`
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ ENV EASYRSA /usr/share/easy-rsa
17
17
ENV EASYRSA_PKI $OPENVPN/pki
18
18
ENV EASYRSA_VARS_FILE $OPENVPN/vars
19
19
20
+ # Prevents refused client connection because of an expired CRL
21
+ ENV EASYRSA_CRL_DAYS 3650
22
+
20
23
VOLUME ["/etc/openvpn"]
21
24
22
25
# Internally uses port 1194/udp, remap using `docker run -p 443:1194/tcp`
Original file line number Diff line number Diff line change @@ -25,6 +25,20 @@ sudo iptables -N DOCKER || echo 'Firewall already configured'
25
25
sudo iptables -I FORWARD 1 -j DOCKER
26
26
docker run -d -v $OVPN_DATA :/etc/openvpn --cap-add=NET_ADMIN --privileged -p 1194:1194/udp --name $NAME $IMG
27
27
28
+
29
+ #
30
+ # Test that easy_rsa generate CRLs with 'next publish' set to 3650 days.
31
+ #
32
+ crl_next_update=" $( docker exec $NAME openssl crl -nextupdate -noout -in /etc/openvpn/crl.pem | cut -d' =' -f2 | tr -d ' GMT' ) "
33
+ crl_next_update=" $( date -u -d " $crl_next_update " " +%s" ) "
34
+ now=" $( docker exec $NAME date " +%s" ) "
35
+ crl_remain=" $(( $crl_next_update - $now )) "
36
+ crl_remain=" $(( $crl_remain / 86400 )) "
37
+ if (( $crl_remain < 3649 )) ; then
38
+ echo " easy_rsa CRL next publish set to less than 3650 days." >&2
39
+ exit 2
40
+ fi
41
+
28
42
#
29
43
# Generate a first client certificate and configuration using $CLIENT1 as CN then revoke it.
30
44
#
You can’t perform that action at this time.
0 commit comments