MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / _client_verify_is_disabled

Function _client_verify_is_disabled

python/openshell/sandbox_test.py:1062–1081  ·  view source on GitHub ↗

Inspect an httpx.Client for verify=False. httpx surfaces verify either on the client directly (older) or via the default transport (newer).

(client: Any)

Source from the content-addressed store, hash-verified

1060
1061
1062def _client_verify_is_disabled(client: Any) -> bool:
1063 """Inspect an httpx.Client for verify=False. httpx surfaces verify
1064 either on the client directly (older) or via the default transport
1065 (newer)."""
1066 if getattr(client, "verify", None) is False:
1067 return True
1068 transport = getattr(client, "_transport", None)
1069 if transport is None:
1070 return False
1071 # httpx's default HTTPTransport wraps an SSL context or a bool.
1072 pool = getattr(transport, "_pool", None)
1073 if pool is not None:
1074 ssl_context = getattr(pool, "_ssl_context", None)
1075 # When verify=False, httpx builds a context without verification.
1076 if ssl_context is not None:
1077 import ssl
1078
1079 return ssl_context.verify_mode == ssl.CERT_NONE
1080 # Fallback: check for any internal `_verify` attribute set to False.
1081 return getattr(transport, "_verify", None) is False
1082
1083
1084def test_refresher_raises_when_bundle_has_no_refresh_token(

Calls

no outgoing calls

Tested by

no test coverage detected