encode / httpcore

A minimal HTTP client. ⚙️
https://www.encode.io/httpcore/
BSD 3-Clause "New" or "Revised" License
465 stars 105 forks source link

extensions `sni_hostname` does't work with http proxy #934

Closed timespace314 closed 3 months ago

timespace314 commented 3 months ago

Does not work (No TLS SNI sent to endpoint)

proxy = httpcore.HTTPProxy(proxy_url="http://127.0.0.1:9091/")
headers = {"Host": "www.encode.io"}
extensions = {"sni_hostname": "www.encode.io"}
proxy.request("GET", "https://185.199.108.153/",  headers=headers, extensions=extensions)

Works

pool = httpcore.ConnectionPool()
headers = {"Host": "www.encode.io"}
extensions = {"sni_hostname": "www.encode.io"}
pool.request("GET", "https://185.199.108.153/",  headers=headers, extensions=extensions)