我怎么能隐藏window哪一个通知安装证书(DO_NOT_TRUST_FiddlerRoot)?

How could i hide the window which one notice to install certificate(DO_NOT_TRUST_FiddlerRoot)?

我开发了一个基于 fiddlerCore 的 wpf 应用程序,witchhelp 我捕获 https resources.then 我发现 question.It 也警告 window 通知安装证书(DO_NOT_TRUST_FiddlerRoot)。我想隐藏这个 window。 enter image description here

安装证书方法如下:

 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;
    }

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

    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();
        }
    }

只需安装认证并存储即可。

像这样,你不会找到"DO_NOT_TRUST_FiddlerRoot" window!