Private
Public Access
The SSRF guard checked that a hostname resolved to public addresses, then let requests resolve it again to connect — so a DNS answer that changed in between (DNS rebinding) could point the connection at an internal address. Connections now go through a pinned adapter whose socket factory resolves, checks and connects inside one function: whatever the name resolves to at connect time is what gets validated and used. Only the socket is replaced, so TLS still verifies against the original hostname. The up-front validate_fetch_url check stays as defense in depth. Tests cover a rebinding answer at connect time being refused and a real loopback round trip with the original Host header preserved; checked live: a real HTTPS feed fetches, 127.0.0.1/169.254.169.254/ localhost are blocked, and a wrong-hostname certificate is still rejected. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>