From c4b63dc48a4ab6d4a9b7e824dba23a806fd6d741 Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Jul 02 2014 14:31:50 +0000 Subject: Clear NSS session cache when socket is closed Even when NSS connection is closed, there may be still cached certificates in the NSS lib. This may cause subsequent NSS initialization to crash. This problem especially reproduces in the unit tests. Reviewed-By: Petr Viktorin --- diff --git a/ipapython/nsslib.py b/ipapython/nsslib.py index 22c81c0..93b0c56 100644 --- a/ipapython/nsslib.py +++ b/ipapython/nsslib.py @@ -247,6 +247,7 @@ class NSSConnection(httplib.HTTPConnection, NSSAddressFamilyFallback): if self.sock: self.sock.close() # close it manually... there may be other refs self.sock = None + ssl.clear_session_cache() def endheaders(self, message=None): """