From 008d4d0ed14b48c6f9bc63cf9cdca98857595a51 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Thu, 6 Dec 2012 22:05:34 -0500 Subject: [PATCH] Bug 769288 - Part 3: Clear all temporary cert overrides upon leaving private browsing. r=bsmith --- security/manager/ssl/src/nsCertOverrideService.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/security/manager/ssl/src/nsCertOverrideService.cpp b/security/manager/ssl/src/nsCertOverrideService.cpp index 456564bd8b8a..e2db1ce91dee 100644 --- a/security/manager/ssl/src/nsCertOverrideService.cpp +++ b/security/manager/ssl/src/nsCertOverrideService.cpp @@ -124,6 +124,7 @@ nsCertOverrideService::Init() if (observerService) { observerService->AddObserver(this, "profile-before-change", true); observerService->AddObserver(this, "profile-do-change", true); + observerService->AddObserver(this, "last-pb-context-exited", true); // simulate a profile change so we read the current profile's settings file Observe(nullptr, "profile-do-change", nullptr); } @@ -168,6 +169,10 @@ nsCertOverrideService::Observe(nsISupports *, } Read(); + } else if (!nsCRT::strcmp(aTopic, "last-pb-context-exited")) { + ClearValidityOverride( + NS_LITERAL_CSTRING("all:temporary-certificates"), + 0); } return NS_OK;