fix(ssl): align guard docs and escape hatch

This commit is contained in:
Teknium
2026-06-13 21:14:32 -07:00
parent 73d1357747
commit 7aaae7acd0
3 changed files with 50 additions and 23 deletions
+10
View File
@@ -70,3 +70,13 @@ def test_verify_ca_bundle_with_fallback_keeps_same_contract(monkeypatch, tmp_pat
monkeypatch.setenv("SSL_CERT_FILE", str(fake))
with pytest.raises(SSLConfigurationError):
verify_ca_bundle_with_fallback()
@pytest.mark.parametrize("value", ["1", "true", "TRUE", "yes", "on"])
def test_skip_env_var_bypasses_guard(monkeypatch, tmp_path, value):
"""HERMES_SKIP_SSL_GUARD is an intentional escape hatch for managed trust stores."""
fake = tmp_path / "missing.pem"
monkeypatch.setenv("HERMES_SKIP_SSL_GUARD", value)
monkeypatch.setenv("SSL_CERT_FILE", str(fake))
verify_ca_bundle()
verify_ca_bundle_with_fallback()