Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2.13.1 (2026/08/11)
==============

Bugfixes
---------
* Pause before connecting over Boundary tunnels, to avoid SSL errors.


2.13.0 (2026/08/11)
==============

Expand Down
5 changes: 5 additions & 0 deletions mycli/boundary_tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

from mycli.compat import WIN

TUNNEL_STABILIZATION_PAUSE = 0.25


class BoundaryTunnelError(RuntimeError):
pass
Expand Down Expand Up @@ -146,6 +148,9 @@ def start(self, *, show_expiration_warning: bool = True) -> None:
self._raise_if_failed()
if self._is_listening():
self._ready.set()
# todo: if this works to ward off SSL errors at connection time,
# try making the pause as small as possible
time.sleep(TUNNEL_STABILIZATION_PAUSE)
return
time.sleep(0.05)
self.close()
Expand Down
10 changes: 8 additions & 2 deletions test/pytests/test_boundary_tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
import pytest

from mycli import boundary_tunnel
from mycli.boundary_tunnel import BoundaryTunnel, BoundaryTunnelError
from mycli.boundary_tunnel import (
TUNNEL_STABILIZATION_PAUSE,
BoundaryTunnel,
BoundaryTunnelError,
)

CONNECTION_DETAILS = (
'{"address":"127.0.0.1","credentials":[{"secret":{"decoded":{"username":"1234","password":"5678"}}}],'
Expand Down Expand Up @@ -478,6 +482,7 @@ def fake_read_stdout() -> None:
monkeypatch.setattr(tunnel, '_read_stdout', fake_read_stdout)
checks = iter([False, True])
monkeypatch.setattr(tunnel, '_is_listening', lambda: next(checks))
monkeypatch.setattr(boundary_tunnel.time, 'sleep', lambda _seconds: None)

tunnel.start()

Expand All @@ -504,6 +509,7 @@ def fake_run() -> None:
monkeypatch.setattr(tunnel, '_authenticate_if_needed', fake_authenticate)
monkeypatch.setattr(tunnel, '_run', fake_run)
monkeypatch.setattr(tunnel, '_is_listening', lambda: True)
monkeypatch.setattr(boundary_tunnel.time, 'sleep', lambda _seconds: None)

tunnel.start()

Expand All @@ -526,7 +532,7 @@ def fake_sleep(seconds: float) -> None:

tunnel.start()

assert sleeps == [0.05]
assert sleeps == [0.05, TUNNEL_STABILIZATION_PAUSE]


def test_boundary_tunnel_start_reports_cli_status_code(monkeypatch: pytest.MonkeyPatch) -> None:
Expand Down
Loading