Skip to content

Commit

Permalink
Fix ssl.PROTOCOL_TLS deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
xzkostyan committed Aug 8, 2024
1 parent 29b9d91 commit 4633400
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions clickhouse_driver/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down

0 comments on commit 4633400

Please sign in to comment.