LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-core_security_transportSSRFSafeTransport
    Classā—Since v1.2

    SSRFSafeTransport

    Copy
    SSRFSafeTransport(
      self,
      policy: SSRFPolicy = SSRFPolicy(),
      **transport_kwargs: object = {}

    Bases

    httpx.AsyncBaseTransport

    Constructors

    Methods

    View source on GitHub
    )
    constructor
    __init__
    NameType
    policySSRFPolicy
    method
    handle_async_request
    method
    aclose

    httpx async transport that validates DNS results against an SSRF policy.

    For every outgoing request the transport:

    1. Checks the URL scheme against policy.allowed_schemes.
    2. Validates the hostname against blocked patterns.
    3. Resolves DNS and validates all returned IPs.
    4. Rewrites the request to connect to the first valid IP while preserving the original Host header and TLS SNI hostname.

    Redirects are re-validated on each hop because follow_redirects is set on the client, causing handle_async_request to be called again for each redirect target.