aeat.adapters.outbound.aeat.auth._certificate_backends._httpx_fallback module¶
Fail-closed httpx mTLS handshake backend.
The Python ssl API used by httpx requires certificate-chain
material to be loaded from file paths. Writing decrypted PEM/key material to
temporary files violates the secure-storage boundary, so this backend fails
closed instead of materialising certificate secrets outside the encrypted
backend.
CertificateBackend.HTTPX_FALLBACK remains available as a dispatch target so
certificate health checks return a structured HandshakeResult instead
of attempting an unsafe downgrade. Browser sessions should use
PlaywrightContextBackend.
- class HttpxFallbackBackend[source]¶
Bases:
_CertBackendmTLS handshake probe that fails closed under the secure-storage policy.
Verify-only backend; rejects any attempt to preload a browser context with
AuthConfigurationError. SeePlaywrightContextBackendfor the interactive counterpart.- preload(cert, context)[source]¶
Reject the call — this backend cannot drive a browser context.
- Parameters:
cert (
LoadedCertificate) – Ignored.context (
object) – Ignored.
- Raises:
AuthConfigurationError – Always.
- Return type:
- verify(cert, url)[source]¶
Return a closed failure without materialising PEM/key files.
httpxcannot consume in-memory PKCS#12 client certificates through Python’s standardsslAPI, and converting the certificate and private key to plaintext temporary files is forbidden because certificate secrets must not bypass the secure-storage boundary. The fallback therefore reports a closed failure rather than degrading the secrecy contract.- Parameters:
cert (
LoadedCertificate) – The loaded PKCS#12 certificate to present.url (
str) – HTTPS endpoint to probe.
- Return type:
- Returns:
A
HandshakeResultdescribing the closed-failure outcome.