feat(openvpn): reduce handshake window to 10 seconds for faster failure detection

This commit is contained in:
Quentin McGaw
2026-04-30 11:53:12 +00:00
parent f1a8303db7
commit f615e3c780
3 changed files with 3 additions and 0 deletions
+1
View File
@@ -76,6 +76,7 @@ func modifyConfig(lines []string, connection models.Connection,
modified = append(modified, "pull-filter ignore \"auth-token\"") // prevent auth failed loop modified = append(modified, "pull-filter ignore \"auth-token\"") // prevent auth failed loop
modified = append(modified, "auth-retry nointeract") modified = append(modified, "auth-retry nointeract")
modified = append(modified, "suppress-timestamps") modified = append(modified, "suppress-timestamps")
modified = append(modified, "handshake-window 10") // default is 60 seconds which is too long
if *settings.User != "" { if *settings.User != "" {
modified = append(modified, "auth-user-pass "+openvpn.AuthConf) modified = append(modified, "auth-user-pass "+openvpn.AuthConf)
} }
@@ -62,6 +62,7 @@ func Test_modifyConfig(t *testing.T) {
"pull-filter ignore \"auth-token\"", "pull-filter ignore \"auth-token\"",
"auth-retry nointeract", "auth-retry nointeract",
"suppress-timestamps", "suppress-timestamps",
"handshake-window 10",
"auth-user-pass /etc/openvpn/auth.conf", "auth-user-pass /etc/openvpn/auth.conf",
"verb 0", "verb 0",
"data-ciphers-fallback cipher", "data-ciphers-fallback cipher",
+1
View File
@@ -62,6 +62,7 @@ func OpenVPNConfig(provider OpenVPNProviderSettings,
lines.add("mute-replay-warnings") // these are often ignored by some VPN providers lines.add("mute-replay-warnings") // these are often ignored by some VPN providers
lines.add("auth-retry", "nointeract") // retry authenticating without interaction lines.add("auth-retry", "nointeract") // retry authenticating without interaction
lines.add("suppress-timestamps") // do not log timestamps, the Gluetun logger takes care of it lines.add("suppress-timestamps") // do not log timestamps, the Gluetun logger takes care of it
lines.add("handshake-window", "10") // default is 60 seconds which is too long
lines.add("dev", settings.Interface) lines.add("dev", settings.Interface)
lines.add("verb", fmt.Sprint(*settings.Verbosity)) lines.add("verb", fmt.Sprint(*settings.Verbosity))
lines.add("proto", connection.Protocol) lines.add("proto", connection.Protocol)