如何导出根证书(Fiddler)

时间:2017-04-03 02:16:02

标签: fiddler

我使用Fiddler dll安装Fiddler证书:

   public static bool InstallCertificate()
    {
        if (!string.IsNullOrEmpty(certmakerBcCert))
        {
            FiddlerApplication.Prefs.SetStringPref("fiddler.certmaker.bc.key", certmakerBcKey);
            FiddlerApplication.Prefs.SetStringPref("fiddler.certmaker.bc.cert", certmakerBcCert);
        }

        if (!CertMaker.rootCertExists())
        {
            //CLog.writeNoLogInDB("Creating SSL certificate");
            if (!CertMaker.createRootCert())
                return false;

            if (!CertMaker.trustRootCert())
                return false;

            certmakerBcCert = FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.cert", null);
            certmakerBcKey = FiddlerApplication.Prefs.GetStringPref("fiddler.certmaker.bc.key", null);
        }
        return true;
    }

我需要导出通过代码创建的RootCertificate文件。有没有办法这样做?

1 个答案:

答案 0 :(得分:1)

(我知道这已经过时了,但是你还没有找到答案或其他人正在搜索)

根据您的代码,您看起来像使用BouncyCastle证书制作者,因此您可以执行此操作以导出根证书:

FiddlerApplication.Prefs.SetBoolPref("fiddler.certmaker.bc.EmitRootCertFile", true)

这将使用空密码在桌面上转储“FiddlerBCRoot.pfx”