Https 我如何隐藏安装证书的通知窗口(DO\u NOT\u TRUST\u fiddleroot)?

Https 我如何隐藏安装证书的通知窗口(DO\u NOT\u TRUST\u fiddleroot)?,https,ssl-certificate,fiddlercore,Https,Ssl Certificate,Fiddlercore,我基于fiddlerCore开发了一个wpf应用程序,它可以帮助我捕获https资源。然后我发现了一个问题。它还提醒一个窗口注意安装证书(DO_NOT_TRUST_FiddlerRoot)。我想隐藏这个窗口。 安装证书方法,如下所示: public static bool InstallCertificate() { if (!CertMaker.rootCertExists()) { if (!CertMaker.create

我基于fiddlerCore开发了一个wpf应用程序,它可以帮助我捕获https资源。然后我发现了一个问题。它还提醒一个窗口注意安装证书(DO_NOT_TRUST_FiddlerRoot)。我想隐藏这个窗口。

安装证书方法,如下所示:

 public static bool InstallCertificate()
    {
        if (!CertMaker.rootCertExists())
        {
            if (!CertMaker.createRootCert())
                return false;

            if (!CertMaker.trustRootCert())
                return false;
            Cert = FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.cert", null);
            Key = FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.key", null);
        }

        return true;
    }

幸运的是,我找到了解决这个问题的办法。 将以下代码添加到myfiddler.cs中的public void DoFiddler()中:

    CONFIG.bCaptureCONNECT = true;
    CONFIG.IgnoreServerCertErrors = false;
    if (!CertMaker.rootCertExists())
    {
        if (!CertMaker.createRootCert())
        {
            throw new Exception("Unable to create cert for FiddlerCore.");
        }
        X509Store certStore = new X509Store(StoreName.Root, StoreLocation.LocalMachine);
        certStore.Open(OpenFlags.ReadWrite);
        try
        {
            certStore.Add(CertMaker.GetRootCertificate());
        }
        finally
        {
            certStore.Close();
        }
    }
只需安装证书并存储即可

像这样,你将不会发现“不信任小提琴”窗口