0

I use Fiddler dll to install Fiddler certificates:

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

However, they don't install into firefox. Every browsers work fine except Firefox. Is there a way to install them into Firefox also through code?

Thanks!!

Note: I already have a program to install a certificate in Firefox, but I need them firstto be generated...

Cher
  • 2,789
  • 10
  • 37
  • 64
  • 1
    Possible duplicate of [Programmatically Install Certificate into Mozilla](http://stackoverflow.com/questions/1435000/programmatically-install-certificate-into-mozilla) – TheNorthWes Mar 15 '17 at 23:32
  • nop I added in description – Cher Mar 15 '17 at 23:36
  • what do you mean generated? – TheNorthWes Mar 15 '17 at 23:39
  • If I have a file that is a certificate, I have a program to install it in FF – Cher Mar 15 '17 at 23:43
  • are you asking how to get the fiddler cert? – TheNorthWes Mar 15 '17 at 23:45
  • well if I can programatically, because so far I generate it through Fiddler application :( sorry for delay – Cher Mar 16 '17 at 00:11
  • Oh you want to get the fiddler cert programmatically! Sorry for the misunderstanding. – TheNorthWes Mar 16 '17 at 00:14
  • well np, maybe I can explain it differently if it's unclear in my description? Feel free to edit it, if you did misunderstood my problem, others will – Cher Mar 16 '17 at 00:18
  • 1
    `CertMaker` has a method that allows you to export the .CER file, you can pass that file into the tool you have that installs the certificate in Firefox. – EricLaw Mar 29 '17 at 16:41
  • @EricLaw this would exactly be what I needed. I searched it for a while of Fiddler site and on forums, didn't come accross it. Would you know about it? – Cher Apr 01 '17 at 19:13
  • 1
    You should use appropriate error checking but here's the general idea: `File.WriteAllBytes("whatever.cer", CertMaker.GetRootCertificate().Export(X509ContentType.Cert));` – EricLaw Apr 03 '17 at 21:51

1 Answers1

0

I believe you can generate and tell fiddler to use it. I would guess that if it doesn't exist, fiddler creates one at install time this here implies there is a set location

TheNorthWes
  • 2,661
  • 19
  • 35
  • 1
    thanks ! will work on that and post again with my results. May take little time – Cher Mar 16 '17 at 00:37
  • The link you've cited concerns *client* certificates, so no, it's not related to the issue at hand. To export the *Fiddler root* certificate, you must do so in another way. – EricLaw Mar 29 '17 at 16:42