Skip to content

Commit 3ebc490

Browse files
author
Luke
committed
automatically add reneg-sec 0 to client and server configs when otp is being used to avoid connection resetting every hour. Edit docs to make clear that a more secure cipher needs to be selected to use with otp to avoid the connection being reset every 64 MB of data
1 parent 1129eb0 commit 3ebc490

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

bin/ovpn_genconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ OVPN_EXTRA_CONFIG=''
161161

162162
# Parse arguments
163163
while getopts ":a:e:C:T:r:s:du:cp:n:DNmf:tz2" opt; do
164+
echo $opt
164165
case $opt in
165166
a)
166167
OVPN_AUTH="$OPTARG"
@@ -329,6 +330,7 @@ cat $TMP_PUSH_CONFIGFILE >> "$conf"
329330
if [ -n "${OVPN_OTP_AUTH:-}" ]; then
330331
echo -e "\n\n# Enable OTP+PAM for user authentication" >> "$conf"
331332
echo "plugin /usr/lib/openvpn/plugins/openvpn-plugin-auth-pam.so openvpn" >> "$conf"
333+
echo "reneg-sec 0" >> "$conf"
332334
fi
333335

334336
echo -e "\n### Extra Configurations Below" >> "$conf"

bin/ovpn_getclient

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ $OVPN_ADDITIONAL_CLIENT_CONFIG
9494
if [ -n "$OVPN_COMP_LZO" ]; then
9595
echo "comp-lzo"
9696
fi
97+
98+
if [ "$OVPN_OTP_AUTH" = "1" ]; then
99+
echo reneg-sec 0
100+
fi
97101
}
98102

99103
dir="$OPENVPN/clients/$cn"

docs/otp.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ and use this image to generate user configuration.
1111

1212
In order to enable two factor authentication the following steps are required.
1313

14-
* Generate server configuration with `-2` option
14+
* Choose a more secure [cipher](https://community.openvpn.net/openvpn/wiki/SWEET32) to use because since [OpenVPN 2.3.13](https://community.openvpn.net/openvpn/wiki/ChangesInOpenvpn23#OpenVPN2.3.13) the default openvpn cipher BF-CBC will cause a renegotiated connection every 64 MB of data
15+
16+
* Generate server configuration with `-2` and `-C $CIPHER` options
1517

1618
docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_genconfig -u udp://vpn.example.com -2
1719

0 commit comments

Comments
 (0)