Skip to content

Commit 92e1ab7

Browse files
cathleenyIsaac
andcommitted
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. Signed-off-by: Cathleen Yan <58714163+cathleeny@users.noreply.github.com> Co-authored-by: Isaac <no-reply@databricks.com>
1 parent 75a0d5d commit 92e1ab7

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

‎CONNECTION_PARAMETERS.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,26 @@ to change without notice.
128128
| `_retry_max_redirects` | `int` | ✅ | ❌ | `None` | Max HTTP redirects to follow (must be ≤ `_retry_stop_after_attempts_count`). Thrift-only. |
129129
| `_enable_v3_retries` | `bool` | ✅ | ❌ | `True` | Use the urllib3-based v3 retry policy; `False` selects the deprecated legacy policy. Thrift-only. |
130130

131+
### SOCKS proxies from environment variables
132+
133+
The connector has no proxy URL parameter; both backends read proxies from the
134+
environment. The backends differ for SOCKS proxies:
135+
136+
- **Kernel** (with a `databricks-sql-kernel` release that supports SOCKS) supports
137+
only the `socks4://`, `socks4a://`, `socks5://` and `socks5h://` SOCKS schemes, in
138+
`HTTPS_PROXY`, or in `ALL_PROXY` when `HTTPS_PROXY` is unset, for all kernel
139+
traffic: queries, CloudFetch downloads and OAuth. `NO_PROXY` hosts connect
140+
directly. `http://` and `https://` proxy URLs work as before. A value with an
141+
unsupported scheme, such as bare `socks://`, is ignored: the kernel then uses
142+
`ALL_PROXY` or connects directly. `socks5` and `socks4` resolve
143+
the target host locally; `socks5h` and `socks4a` let the proxy resolve it. SOCKS5
144+
credentials go in the URL userinfo (`socks5h://user:password@proxy:1080`;
145+
percent-encode reserved characters). SOCKS4 has no password, and the user ID is
146+
not sent. If a proxy with a supported scheme is unreachable or rejects the
147+
credentials, the connection fails; it never falls back to a direct connection.
148+
- **Thrift** has no SOCKS support. A SOCKS `HTTPS_PROXY` fails with urllib3's
149+
`ProxySchemeUnknown`, and `ALL_PROXY` is ignored, so Thrift connects directly.
150+
131151
## TLS / SSL
132152

133153
> TLS options are assembled into a single `SSLOptions` object in `session.py`
@@ -225,6 +245,8 @@ are forwarded when supported by the installed kernel binding.
225245
2. Custom `oauth_scopes`.
226246
3. Kernel U2M encrypted token storage (`oauth_token_cache_enabled`).
227247
4. Telemetry flush interval (`telemetry_flush_interval_ms`).
248+
5. SOCKS proxies from `HTTPS_PROXY` / `ALL_PROXY` (see
249+
[SOCKS proxies from environment variables](#socks-proxies-from-environment-variables)).
228250

229251
### Behavioral divergences to watch
230252

0 commit comments

Comments
 (0)