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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sni_requests-0.1.1.tar.gz.
File metadata
- Download URL: sni_requests-0.1.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b703d52cc8ce1d68522239c8221773d036759b48eecd5a91c0d4ccca881fa40c
|
|
| MD5 |
55538308c309b29ac820635a482fc54a
|
|
| BLAKE2b-256 |
e4577b69df92620bf3b9cf32308ff9ee021a9e374ac539fc58fdea2793db36eb
|
File details
Details for the file sni_requests-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sni_requests-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcb6156a70f955125926ae4e45935fe46057bb4771183e70f8ca716f7d1b1cd9
|
|
| MD5 |
9144eb0496a63b58ec9773976eec44f6
|
|
| BLAKE2b-256 |
878bf5fd0b7ec77ecdd216281ad64c808d54f4f448aac6e7d211e1024b048061
|