reload the current cert database if the certificate was added
authorBrendan Forster <brendan@github.com>
Mon, 24 Apr 2017 01:10:41 +0000 (11:10 +1000)
committerBrendan Forster <brendan@github.com>
Mon, 24 Apr 2017 01:12:26 +0000 (11:12 +1000)
atom/browser/ui/certificate_trust_win.cc

index b4752b88c100d29e71c90b639331c2dd437539eb..6d5eeb384da59fb49c680c295f261d0c133bcc3b 100644 (file)
@@ -8,6 +8,7 @@
 #include <windows.h>
 
 #include "base/callback.h"
+#include "net/cert/cert_database.h"
 
 namespace certificate_trust {
 
@@ -35,6 +36,13 @@ void ShowCertificateTrust(atom::NativeWindow* parent_window,
         CERT_STORE_ADD_REPLACE_EXISTING,
         NULL);
 
+    if (result) {
+        auto cert_db = net::CertDatabase::GetInstance();
+        // Force Chromium to reload the certificate since it might be trusted
+        // now.
+        cert_db->NotifyObserversCertDBChanged(cert.get());
+    }
+
     CertCloseStore(hCertStore, CERT_CLOSE_STORE_FORCE_FLAG);
 
     CertFreeCertificateContext(pCertContext);