Prove pinned HTTPS SNI on a loopback handshake - #8
Conversation
The pin rewrites only the TCP peer; Host and SNI must stay on the origin name. That was documented and Host-header tested, not handshake-tested. httpx still has no public network_backend hook, so the private pool assignment stays and fails closed if the internals change. Co-authored-by: Cursor <cursoragent@cursor.com>
|
| Filename | Overview |
|---|---|
| src/coldscreen/site.py | Adds additive constructor keyword forwarding while retaining the guarded, unconditional installation of the pinned network backend. |
| tests/test_site.py | Adds verified loopback TLS/SNI coverage and a focused test for fail-closed behavior when the expected httpx pool is unavailable. |
| DECISIONS.md | Records why the private httpx pool assignment remains necessary and how its compatibility risk is contained. |
| FUTURE.md | Replaces the completed SNI-test task with the remaining public-backend-hook migration. |
| HANDOFF.md | Updates project status and recommended future work to reflect the new TLS proof. |
Sequence Diagram
sequenceDiagram
participant Client as httpx Client
participant Transport as _PinnedTransport
participant Pinner as _HostPinner
participant TLS as Loopback TLS Server
Client->>Transport: GET https://sni-pin.example:port/hello
Transport->>Pinner: pin(sni-pin.example)
Pinner-->>Transport: 127.0.0.1
Transport->>TLS: TCP connect to 127.0.0.1
Transport->>TLS: TLS ClientHello (SNI: sni-pin.example)
TLS-->>Client: Verified HTTPS response
Reviews (1): Last reviewed commit: "Prove the pinned site transport keeps TL..." | Re-trigger Greptile
Summary
sni-pin.example), with verify-on against a runtime openssl cert._pool._network_backendassignment fail-closed: installedHTTPTransportstill has no publicnetwork_backendhook. Record that choice in DECISIONS.md.RuntimeErrorwhen_poolis not aConnectionPool. Production_SiteFetcherstill constructs_PinnedTransport(pinner)with default verify-on.Test plan
checkson 3.11, 3.12, and 3.13 (this test needs openssl on PATH and loopback sockets; ubuntu-latest has both)test_pinned_transport_preserves_tls_sni_on_the_origin_hostnameran rather than skipped