Skip to content

fix(oracle): follow a listener redirect through the connection's SSH tunnel or SOCKS proxy - #4785

Merged
datlechin merged 5 commits into
mainfrom
feat/oracle-redirect-through-tunnel
Nov 30, 2026
Merged

datlechin merged 5 commits into
mainfrom
feat/oracle-redirect-through-tunnel

Conversation

@datlechin

@datlechin datlechin commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • An Oracle connection over an SSH tunnel or a SOCKS proxy now follows a listener's TNS redirect (RAC SCAN, shared server, Connection Manager) through the same tunnel. Before, it stopped with "Listener Redirect Not Followed" and asked for the target by hand. Follows fix(plugin-oracle): follow TNS listener redirects #4610.
  • PluginKit: new host capability DriverConnectionConfig.openForward(host, port) -> PluginForwardedEndpoint, the same shape as refreshPassword. New primary init; the previous one is @_disfavoredOverload. Additive. It shares kit 48 with fix(results): a Stop holds back a script's next statement, which reaches the driver as the user's #4778, so no second bump; minimum stays 19. An older app refuses the kit-48 Oracle plugin by version instead of failing its load.
  • Host: TunnelForwardOpening on SSHTunnelManager and SOCKSProxyManager. A forward opens only on the connection's own live tunnel:
    • SSH: a second listener on the tunnel's shared session and lease, with the same destination probe and channel hand-off as the first forward. No route is resolved and nothing signs in again, so a Team Library row stays on the chain its approval resolved.
    • SOCKS: a second loopback listener through the tunnel's own proxy and credentials. A loopback target is refused, since Network.framework dials it past the proxy.
    • Forwards close with their tunnel. One open per tunnel and target is shared, and a tunnel opens at most 16. A driver of a replaced tunnel is refused.
    • Cloudflare and a tunnel command get no capability and keep naming the target.
  • oracle-nio fork: Configuration.redirectDialAddress maps the target to the address a hop dials. TLS and errors keep naming the target, and each hop checks the certificate against its own target. Pinned to 3f594c3, merged into tablepro-main by feat: dial a redirect hop at the address the caller maps its target to oracle-nio#18.
  • TableProOracleCore: OracleListenerRedirects replaces the followsListenerRedirects flag. New errors name the target when the tunnel cannot open the forward, and when Verify Identity meets an IP target behind a tunnel.
  • Out of scope: the iOS SSH tunnel offers no added forward yet, so a redirect there still names the target. Follow-up.
  • Docs: docs(databases): Oracle redirects follow an SSH tunnel or SOCKS proxy docs#334 (draft).

Test plan

  • OracleRedirectThroughTunnelTests (TableProOracleCoreTests, new): fake TNS listeners on loopback. A SCAN-style REDIRECT to node2.invalid:1531 goes through the opener and the hop reaches the mapped port; a failed forward says so and dials nothing; Verify Identity refuses an IP target before any forward opens.
  • Updated on purpose: OracleConnectFailureMappingTests.theConfigurationCarriesWhetherToFollowRedirects (the flag became listenerRedirects: .notFollowed).
  • SOCKSProxyManagerTests against FakeSOCKS5Server: an added forward goes through the tunnel's proxy and credentials with the name unresolved, is shared, needs the tunnel, refuses loopback, closes with the tunnel, is capped.
  • TunnelForwardingTests (new): only SSH and SOCKS get the capability; the opener asks the connection's own tunnel and refuses unusable targets first; an SSH forward without a tunnel binds and dials nothing.
  • DriverConnectionConfigOpenForwardTests (TableProPluginKitTests, new). PluginInstallerHelpersTests covers the older host refusing a newer kit.
  • Fork: RedirectFollowingTests (aRoutedHopDialsTheAddressTheCallerGivesAndNamesTheTarget, aRouteThatFailsIsTheRedirectsFailureAndDialsNothing, aRouteThatNeverAnswersEndsWithTheLoginDeadline), ConfigurationTests.aRedirectHopNamesItsTargetForTLSAndDialsItUnlessRouted.
  • Probes: check-ssh-tunnel-matrix.sh macos/v10/added-forward-one-signin (an added forward on the session, one sign-in in sshd's log); check-oracle-listener-redirect.sh gains a forwarded hop.
  • verify.sh package TableProOracle: 525 of 525. verify.sh package TableProCore DriverConnectionConfig: 5 of 5.
  • verify.sh test (TunnelForwardingTests, SOCKSProxyManagerTests, DatabaseManagerTunnelTests, PluginInstallerHelpersTests, SSHTunnelLocalPortTests, SharedRowSSHDialTests, SSHSessionRegistryTests): 93 of 93.
  • verify.sh abi v0.89.0-beta.3: changed; kit 48, minimum 19, no checker error.
  • verify.sh plugins, verify.sh build, verify.sh l10n (mac and ios), verify.sh lint on each changed Swift file: PASS. verify.sh ios OracleErrorClassifierTests: 4 of 4.
  • Fork suites in a scratch copy: RedirectFollowingTests 9, ConfigurationTests 12, RefuseRedirectTests 15, all pass.
  • macos/v10/added-forward-one-signin against ssh-test-servers.sh: CONNECTED forward, signins=1, two direct-tcpip channels on one session.
  • Codex review, read-only, 5 rounds. Before the rebase onto fix(results): a Stop holds back a script's next statement, which reaches the driver as the user's #4778: 6 findings, then 2, then none, all fixed (Swift 6 @Sendable closure, forward open bound by the login deadline and by cancellation, pending opens counted and cancelled with the tunnel, a probe kept inside the lease, a driver bound to the tunnel it was created on, SOCKS accepts bound to their tunnel). After: one P2, an added SOCKS listener that failed to start was never cancelled, fixed in this PR; then no findings.

@datlechin
datlechin merged commit f2adcfd into main Nov 30, 2026
1 of 2 checks passed
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