encode/httpcore

Add an `sni_hostname` request extension.

tomchristie opened this issue · 0 comments

Add a request extension called "sni_hostname", which may be used to control the hostname used when initiating an SSL connection.

This would be an optional override, instead of using the hostname from the URL...

kwargs = {
"ssl_context": ssl_context,
"server_hostname": self._origin.host.decode("ascii"),
"timeout": timeout,
}
async with Trace("connection.start_tls", request, kwargs) as trace:
stream = await stream.start_tls(**kwargs)
trace.return_value = stream

Refs: encode/httpx#2592 (comment)