Esempio n. 1
0
        internal static bool trustRootCert()
        {
            if (oCertProvider != null)
            {
                return(oCertProvider.TrustRootCertificate());
            }
            X509Certificate2 certificate = FindCert(CONFIG.sMakeCertRootCN, false);

            if (certificate == null)
            {
                return(false);
            }
            try
            {
                X509Store store = new X509Store(StoreName.Root, StoreLocation.CurrentUser);
                store.Open(OpenFlags.ReadWrite);
                try
                {
                    store.Add(certificate);
                }
                finally
                {
                    store.Close();
                }
                return(true);
            }
            catch (Exception exception)
            {
                FiddlerApplication.Log.LogFormat("!Fiddler.CertMaker> Unable to auto-trust root: {0}", new object[] { exception });
                return(false);
            }
        }
Esempio n. 2
0
 public static bool trustRootCert()
 {
     return(oCertProvider.TrustRootCertificate());
 }