Fixing bug with session logging shared ciphers

This change fixes a bug with the KmipSession logging shared
ciphers used by the TLS connection. The SSLSocket only supports
shared cipher information starting with Python 3.5. Any use of
the server with older versions of Python will fail when any
connection attempts are made. This fix adds a conditional check
that skips logging shared cipher information if the SSLSocket
does not support that information.

Fixes #361
This commit is contained in:
Peter Hamilton 2017-11-08 10:19:04 -05:00
parent 0cb4c98770
commit 86d9b59d1f
1 changed files with 7 additions and 6 deletions

View File

@ -158,6 +158,7 @@ class KmipSession(threading.Thread):
max_size = self._max_response_size
try:
if hasattr(self._connection, 'shared_ciphers'):
shared_ciphers = self._connection.shared_ciphers()
self._logger.debug(
"Possible session ciphers: {0}".format(len(shared_ciphers))