reload the current cert database if the certificate was added

This commit is contained in:
Brendan Forster 2017-04-24 11:10:41 +10:00
parent 304c8b9562
commit ac3385124a

View 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);