Skip to content

fix: skip OpenVPN TCP preflight check for WireGuard and ProTun - #39

Closed
everettmorgan wants to merge 1 commit into
ProtonVPN:stablefrom
everettmorgan:fix/skip-openvpn-tcp-check-for-wireguard
Closed

everettmorgan wants to merge 1 commit into
ProtonVPN:stablefrom
everettmorgan:fix/skip-openvpn-tcp-check-for-wireguard

Conversation

@everettmorgan

Copy link
Copy Markdown

Summary

LinuxNetworkManager.start() currently gates every connection attempt on a 5-second TCP probe against self._vpnserver.openvpn_ports.tcp ([443, 7770, 8443]), even when the selected protocol is Wireguard or Protun:

server_reachable = await tcpcheck.is_any_port_reachable(
    self._vpnserver.server_ip,
    self._vpnserver.openvpn_ports.tcp
)

Why this is problematic for Wireguard and Protun:

  1. The TCP probe was originally introduced for NMKillSwitch (where OpenVPN could try to bind through the dummy kill-switch interface). WGKillSwitch already installs an explicit /32 route to the VPN server on the physical interface before start() is called (and Protun passes infer_parent_connection=True to NetworkManager).
  2. Probing OpenVPN TCP ports before starting a UDP WireGuard tunnel causes false-negative VPN server NOT reachable → events.Timeout failures whenever OpenVPN TCP ports are filtered/unresponsive or while the physical interface is still settling after WGKillSwitch's device.reapply_async() call (see WireGuard connection fails on Python 3.14: run_in_executor socket checks always return False in tcpcheck.py #20).

Change

  • Add a requires_openvpn_tcp_check = True class attribute on LinuxNetworkManager (preserving default behavior for OpenVPN and any other subclasses).
  • Set requires_openvpn_tcp_check = False on Wireguard and Protun.
  • Add unit test coverage in tests/python/networkmanager/core/test_networkmanager.py.

Complements #25 and #36 without overlapping files.

@everettmorgan
everettmorgan force-pushed the fix/skip-openvpn-tcp-check-for-wireguard branch from a98e6db to 95f3e6b Compare October 30, 2026 15:52
@everettmorgan

Copy link
Copy Markdown
Author

Closing this — it was a local dogfood experiment, not ready for upstream. Sorry for the noise.

@everettmorgan
everettmorgan deleted the fix/skip-openvpn-tcp-check-for-wireguard branch October 30, 2026 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant