hotfix(openvpn): fix support for tcp-client

- always use `proto tcp-client` when using TCP
- parses `tcp-client` (on top of `tcp`, `tcp4`, `tcp6`) as meaning TCP
- Fix #3302
This commit is contained in:
Quentin McGaw
2026-05-01 00:39:54 +00:00
parent 704a7fd7ef
commit 66b9f71ecf
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -65,7 +65,11 @@ func OpenVPNConfig(provider OpenVPNProviderSettings,
lines.add("handshake-window", "10") // default is 60 seconds which is too long
lines.add("dev", settings.Interface)
lines.add("verb", fmt.Sprint(*settings.Verbosity))
lines.add("proto", connection.Protocol)
protocol := connection.Protocol
if protocol == constants.TCP {
protocol = "tcp-client"
}
lines.add("proto", protocol)
lines.add("remote", connection.IP.String(), fmt.Sprint(connection.Port))
if *settings.User != "" {
+1 -1
View File
@@ -25,7 +25,7 @@ func ExtractProto(b []byte) (tcp, udp bool, err error) {
s = strings.TrimSpace(s)
s = strings.ToLower(s)
switch s {
case "tcp", "tcp4", "tcp6":
case "tcp", "tcp4", "tcp6", "tcp-client":
return true, false, nil
case "udp", "udp4", "udp6":
return false, true, nil