# validate_hostname

> **Function** in `langchain_core`

📖 [View in docs](https://reference.langchain.com/python/langchain-core/_security/_policy/validate_hostname)

Validate a hostname against the SSRF policy.

Raises SSRFBlockedError if the hostname is blocked.

## Signature

```python
validate_hostname(
    hostname: str,
    policy: SSRFPolicy,
) -> None
```

---

[View source on GitHub](https://github.com/langchain-ai/langchain/blob/625ed0ee8c683dd8a7d87564a14bdbd4472d2a44/libs/core/langchain_core/_security/_policy.py#L211)