From 463340002958a41bf1ee0a2d80399b08b407d8f5 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev Date: Thu, 8 Aug 2024 13:26:13 +0300 Subject: [PATCH] Fix ssl.PROTOCOL_TLS deprecation warning --- clickhouse_driver/connection.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clickhouse_driver/connection.py b/clickhouse_driver/connection.py index 8908e257..007a1270 100644 --- a/clickhouse_driver/connection.py +++ b/clickhouse_driver/connection.py @@ -305,15 +305,14 @@ def _create_socket(self, host, port): def _create_ssl_context(self, ssl_options): purpose = ssl.Purpose.SERVER_AUTH - version = ssl_options.get('ssl_version', ssl.PROTOCOL_TLS) + version = ssl_options.get('ssl_version', ssl.PROTOCOL_TLS_CLIENT) context = ssl.SSLContext(version) context.check_hostname = self.verify_cert if 'ca_certs' in ssl_options: context.load_verify_locations(ssl_options['ca_certs']) elif ssl_options.get('cert_reqs') != ssl.CERT_NONE: - context.load_default_certs(purpose - ) + context.load_default_certs(purpose) if 'ciphers' in ssl_options: context.set_ciphers(ssl_options['ciphers'])