Skip to main content

A requests wrapper that allows setting a custom SNI hostname for HTTPS connections

Project description

sni_requests: A Simple SNI Spoofing Wrapper for requests

This module is a drop-in wrapper around requests that lets you spoof or disable SNI (Server Name Indication) during HTTPS connections.

Why? Some servers behave differently based on the SNI hostname. This can be used to bypass security rules, test edge cases, or mimic unusual clients.


🚀 Installation

Just drop sni_requests.py in your project folder. It uses requests and urllib3, which you probably already have.

pip install requests urllib3

🧠 Quick Start

✅ Normal request (like requests.get)

from sni_requests import get

r = get("https://example.com")
print(r.status_code)

🕵️‍♂️ SNI Spoofing

Send SNI for a different hostname than the URL.

r = get("https://1.2.3.4", sni="example.com")
print(r.text)

Send text SNI that are not domains

r = get("https://1.2.3.4", sni="hello world")
print(r.text)

🚫 Disable SNI

Send no SNI at all (unusual, but possible).

r = get("https://example.com", no_sni=True)
print(r.status_code)

🧰 All Methods Supported

Use any HTTP verb you like:

from sni_requests import post, put, delete, patch, head, options

# spoofed POST
r = post("https://1.2.3.4", sni="api.example.com", json={"hello": "world"})

🧵 Want more control?

Use the Session class directly:

from sni_requests import Session

session = Session(sni="example.com")
r = session.get("https://1.2.3.4")
session.close()

👨‍💻 Built by zen for hackers, testers, and tinkerers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sni_requests-0.1.2.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sni_requests-0.1.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file sni_requests-0.1.2.tar.gz.

File metadata

  • Download URL: sni_requests-0.1.2.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for sni_requests-0.1.2.tar.gz
Algorithm Hash digest
SHA256 636a642f784133b20deefaf81b9f1f274073a69d9bfe9d2219c26a7a89c1cdee
MD5 17a6ce1f263a01c4181c79860d9a1f24
BLAKE2b-256 ab1c44d2f811c33d35b189a8ebc5b3d0c519022ab091366e3e02e799e1b1c973

See more details on using hashes here.

File details

Details for the file sni_requests-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sni_requests-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.0

File hashes

Hashes for sni_requests-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ffe89aa47c5469815725f32f755add75c1c6ad362a7f9d443d6c1728017d335b
MD5 4bb1befae6d627d5cd0c8b0b17f09af1
BLAKE2b-256 41af375358569ec33e3d2f5ceb000c97abebdcfb6979638895af8aa089a5bffd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page