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 <pviktori@redhat.com>
This commit is contained in:
Martin Kosek 2014-07-02 14:40:45 +02:00 committed by Petr Viktorin
parent 8c98561c20
commit c4b63dc48a

View File

@ -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):
"""