Skip to content

Commit

Permalink
Fix deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
eandersson committed Oct 13, 2024
1 parent 7fd5e10 commit e72d176
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion amqpstorm/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,13 @@ def _ssl_wrap_socket(self, sock):
server_hostname=hostname
)
hostname = self._parameters['hostname']
context = ssl.SSLContext(ssl.PROTOCOL_TLS)

if hasattr(ssl, 'PROTOCOL_TLS_CLIENT'):
protocol = ssl.PROTOCOL_TLS_CLIENT
else:
protocol = ssl.PROTOCOL_TLS

context = ssl.SSLContext(protocol)
mode = self._parameters['ssl_options'].get('verify_mode', 'none')
if mode.lower() == 'required':
context.verify_mode = ssl.CERT_REQUIRED
Expand Down

0 comments on commit e72d176

Please sign in to comment.