mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
13 lines
388 B
Python
13 lines
388 B
Python
import ssl
|
|
|
|
|
|
class WrapSSLContextWithSNI(ssl.SSLContext):
|
|
def __new__(cls, ssl_host, *args, **kwargs):
|
|
self = super().__new__(cls, *args, **kwargs)
|
|
self._server_hostname = ssl_host
|
|
return self
|
|
|
|
def wrap_socket(self, sock, *args, **kwargs):
|
|
kwargs["server_hostname"] = self._server_hostname
|
|
return super().wrap_socket(sock, *args, **kwargs)
|