summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: