summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Haen <christophe.haen@cern.ch>2020-06-15 16:10:53 +0200
committerMatěj Cepl <mcepl@cepl.eu>2020-07-13 22:37:41 +0200
commit35d463d8eee7f9ab5d2b431caad8f4cd4dd0f946 (patch)
tree397ce5f1f529fdd18f9724f245ef0b5601fa78d8
parentabd5e522153f78c29bf22d6a5cca2b68bc2c0edd (diff)
downloadm2crypto-35d463d8eee7f9ab5d2b431caad8f4cd4dd0f946.tar.gz
SSL.Connection: make the clientPostConnectionCheck an instance attribute
-rw-r--r--M2Crypto/SSL/Connection.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/M2Crypto/SSL/Connection.py b/M2Crypto/SSL/Connection.py
index 45b3ee6..a5863ff 100644
--- a/M2Crypto/SSL/Connection.py
+++ b/M2Crypto/SSL/Connection.py
@@ -37,7 +37,6 @@ def _serverPostConnectionCheck(*args, **kw):
class Connection(object):
"""An SSL connection."""
- clientPostConnectionCheck = Checker.Checker()
serverPostConnectionCheck = _serverPostConnectionCheck
m2_bio_free = m2.bio_free
@@ -52,6 +51,10 @@ class Connection(object):
:param sock: socket to be used
:param family: socket family
"""
+ # The Checker needs to be an instance attribute
+ # and not a class attribute for thread safety reason
+ self.clientPostConnectionCheck = Checker.Checker()
+
self.ctx = ctx
self.ssl = m2.ssl_new(self.ctx.ctx) # type: bytes
if sock is not None: