Notify that the cert changed
This commit is contained in:
parent
bde2a597f3
commit
4f3d3557cc
1 changed files with 11 additions and 4 deletions
|
@ -15,6 +15,7 @@
|
||||||
#include "base/mac/scoped_cftyperef.h"
|
#include "base/mac/scoped_cftyperef.h"
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
#include "net/cert/x509_certificate.h"
|
#include "net/cert/x509_certificate.h"
|
||||||
|
#include "net/cert/cert_database.h"
|
||||||
|
|
||||||
namespace atom {
|
namespace atom {
|
||||||
|
|
||||||
|
@ -29,14 +30,20 @@ void ShowCertificateTrustUI(atom::NativeWindow* parent_window,
|
||||||
SecTrustCreateWithCertificates(cert->CreateOSCertChainForCert(), sec_policy, &trust);
|
SecTrustCreateWithCertificates(cert->CreateOSCertChainForCert(), sec_policy, &trust);
|
||||||
// CFRelease(sec_policy);
|
// CFRelease(sec_policy);
|
||||||
|
|
||||||
NSWindow* window = parent_window ?
|
// NSWindow* window = parent_window ?
|
||||||
parent_window->GetNativeWindow() :
|
// parent_window->GetNativeWindow() :
|
||||||
NULL;
|
// NULL;
|
||||||
|
|
||||||
auto msg = base::SysUTF8ToNSString(message);
|
auto msg = base::SysUTF8ToNSString(message);
|
||||||
|
|
||||||
SFCertificateTrustPanel *panel = [[SFCertificateTrustPanel alloc] init];
|
SFCertificateTrustPanel *panel = [[SFCertificateTrustPanel alloc] init];
|
||||||
[panel beginSheetForWindow:window modalDelegate:nil didEndSelector:NULL contextInfo:NULL trust:trust message:msg];
|
[panel runModalForTrust:trust message:msg];
|
||||||
|
// [panel beginSheetForWindow:window modalDelegate:nil didEndSelector:NULL contextInfo:NULL trust:trust message:msg];
|
||||||
|
|
||||||
|
auto cert_db = net::CertDatabase::GetInstance();
|
||||||
|
// This forces Chromium to reload the certificate since it might be trusted
|
||||||
|
// now.
|
||||||
|
cert_db->NotifyObserversCertDBChanged(cert.get());
|
||||||
|
|
||||||
callback.Run(true);
|
callback.Run(true);
|
||||||
// CFRelease(trust);
|
// CFRelease(trust);
|
||||||
|
|
Loading…
Reference in a new issue