From 1edd69d07f3898c11588898cf2ef1d9a9cc11230 Mon Sep 17 00:00:00 2001 From: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Date: Mon, 30 Nov 2026 09:24:09 +0000 Subject: [PATCH] docs: describe SOCKS proxies from the environment on the kernel backend Once the installed databricks-sql-kernel supports SOCKS, use_kernel=True connections honor socks4/socks4a/socks5/socks5h URLs in HTTPS_PROXY, or in ALL_PROXY when HTTPS_PROXY is unset, with NO_PROXY bypass, through the kernel's existing environment-proxy handling. The connector needs no code change for this. Record it in CONNECTION_PARAMETERS.md as a documented difference from Thrift: the variables honored, DNS per scheme (socks5/socks4 resolve locally, socks5h/socks4a at the proxy), credentials as URL userinfo, fail-closed behavior, and that Thrift raises ProxySchemeUnknown for a SOCKS HTTPS_PROXY and ignores ALL_PROXY. Bump KERNEL_REV to a29235cbea9532efa5572ebff010045583a19cbe, the merged kernel SOCKS change (databricks/databricks-sql-kernel#518), so kernel-e2e builds a wheel that supports SOCKS proxies. Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac --- CONNECTION_PARAMETERS.md | 22 ++++++++++++++++++++++ KERNEL_REV | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CONNECTION_PARAMETERS.md b/CONNECTION_PARAMETERS.md index 6d4f336fd..4e91c6597 100644 --- a/CONNECTION_PARAMETERS.md +++ b/CONNECTION_PARAMETERS.md @@ -128,6 +128,26 @@ to change without notice. | `_retry_max_redirects` | `int` | ✅ | ❌ | `None` | Max HTTP redirects to follow (must be ≤ `_retry_stop_after_attempts_count`). Thrift-only. | | `_enable_v3_retries` | `bool` | ✅ | ❌ | `True` | Use the urllib3-based v3 retry policy; `False` selects the deprecated legacy policy. Thrift-only. | +### SOCKS proxies from environment variables + +The connector has no proxy URL parameter; both backends read proxies from the +environment. The backends differ for SOCKS proxies: + +- **Kernel** (with a `databricks-sql-kernel` release that supports SOCKS) supports + only the `socks4://`, `socks4a://`, `socks5://` and `socks5h://` SOCKS schemes, in + `HTTPS_PROXY`, or in `ALL_PROXY` when `HTTPS_PROXY` is unset, for all kernel + traffic: queries, CloudFetch downloads and OAuth. `NO_PROXY` hosts connect + directly. `http://` and `https://` proxy URLs work as before. A value with an + unsupported scheme, such as bare `socks://`, is ignored: the kernel then uses + `ALL_PROXY` or connects directly. `socks5` and `socks4` resolve + the target host locally; `socks5h` and `socks4a` let the proxy resolve it. SOCKS5 + credentials go in the URL userinfo (`socks5h://user:password@proxy:1080`; + percent-encode reserved characters). SOCKS4 has no password, and the user ID is + not sent. If a proxy with a supported scheme is unreachable or rejects the + credentials, the connection fails; it never falls back to a direct connection. +- **Thrift** has no SOCKS support. A SOCKS `HTTPS_PROXY` fails with urllib3's + `ProxySchemeUnknown`, and `ALL_PROXY` is ignored, so Thrift connects directly. + ## TLS / SSL > TLS options are assembled into a single `SSLOptions` object in `session.py` @@ -224,6 +244,8 @@ are forwarded when supported by the installed kernel binding. 2. Custom `oauth_scopes`. 3. Kernel U2M encrypted token storage (`oauth_token_cache_enabled`). 4. Telemetry flush interval (`telemetry_flush_interval_ms`). +5. SOCKS proxies from `HTTPS_PROXY` / `ALL_PROXY` (see + [SOCKS proxies from environment variables](#socks-proxies-from-environment-variables)). ### Behavioral divergences to watch diff --git a/KERNEL_REV b/KERNEL_REV index 101d21c5a..418c81d3b 100644 --- a/KERNEL_REV +++ b/KERNEL_REV @@ -1 +1 @@ -3b691d2a2c235ef847d61b308c31604979830994 +a29235cbea9532efa5572ebff010045583a19cbe