From 35d463d8eee7f9ab5d2b431caad8f4cd4dd0f946 Mon Sep 17 00:00:00 2001 From: Christophe Haen Date: Mon, 15 Jun 2020 16:10:53 +0200 Subject: SSL.Connection: make the clientPostConnectionCheck an instance attribute --- M2Crypto/SSL/Connection.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: -- cgit v1.2.1