fix(ssl): use default SSL context for all httpx calls; add opt-out verify for debugging #11051
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
While testing OpenHands behind enterprise TLS interception/self-signed corporate roots, I hit
SSL: CERTIFICATE_VERIFY_FAILED
. Many orgs install a private root CA in the OS trust store; however severalhttpx
clients weren’t explicitly using a default SSL context.This PR ensures all
httpx
calls consistently use the expected system default SSL context. It also adds a debug-only escape hatch to disable verification via config/env vars when needed.What’s changed
openhands.utils.http_session
:httpx_verify_option()
for consistentverify=
acrosshttpx
clients (async & sync).configure_http_session(verify=...)
.INSECURE_SKIP_VERIFY
(also acceptsOPENHANDS_INSECURE_SKIP_VERIFY
) — default is secure (verify on).httpx
clients:config.template.toml
: addinsecure_skip_verify
(commented, NOT recommended).openhands/core/config/openhands_config.py
: addinsecure_skip_verify: bool | None
.openhands/core/config/utils.py
: callconfigure_http_session()
based on config/env.docs/usage/environment-variables.mdx
: documentINSECURE_SKIP_VERIFY
.Motivation
insecure_skip_verify
) helps debug TLS issues without blocking critical flows (e.g., first-time setup, CI smoke tests).Usage notes
INSECURE_SKIP_VERIFY=true
config.toml
:Testing
INSECURE_SKIP_VERIFY
.Security considerations
insecure_skip_verify
is explicitly documented as NOT recommended and intended for temporary debugging only.Thanks
Really happy to use OpenHands — huge thanks to the team and the community for the awesome project and support 🙏