Ejemplo n.º 1
0
        private static void onValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e)
        {
            if (SslPolicyErrors.None == e.CertificatePolicyErrors)
            {
                return;
            }

            e.ValidityState = CertificateValidity.ForceValid;
        }
Ejemplo n.º 2
0
            internal void OnOnValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e)
            {
                EventHandler <ValidateServerCertificateEventArgs> handler = OnValidateServerCertificate;

                if (handler != null)
                {
                    handler(this, e);
                }
            }
Ejemplo n.º 3
0
 private void ftp_ValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e)
 {
     // display the certificate to the user and ask the user to either accept or reject the certificate
     if (MessageBox.Show(e.Certificate.ToString(), "FTPbox - Accept this Certificate?", MessageBoxButtons.YesNo) == DialogResult.Yes)
     {
         // the user accepted the certicate so we need to inform the FtpClient Component that the certificate is valid
         // be setting the IsCertificateValue property to true
         e.IsCertificateValid = true;
     }
 }
Ejemplo n.º 4
0
 private void CertificateValidationHandler(object sender, ValidateServerCertificateEventArgs e)
 {
     lock (ServerCertificates)
     {
         var key = Tuple.Create(e.Session.hostname, e.Session.port);
         if (!ServerCertificates.ContainsKey(key))
         {
             ServerCertificates.Add(key, Tuple.Create(new X509Chain(e.ServerCertificateChain.ChainContext), new X509Certificate2(e.ServerCertificate)));
         }
     }
 }
Ejemplo n.º 5
0
        /// <summary>
        /// This callback allows your code to evaluate the certificate for a site and optionally override default validation behavior for that certificate.
        /// You should not implement this method unless you understand why it is a security risk.
        /// </summary>
        static void CheckCert(object sender, ValidateServerCertificateEventArgs e)
        {
            if (null != e.ServerCertificate)
            {
                Console.WriteLine("Certificate for " + e.ExpectedCN + " was for site " + e.ServerCertificate.Subject + " and errors were " + e.CertificatePolicyErrors.ToString());

                if (e.ServerCertificate.Subject.Contains("fiddler2.com"))
                {
                    Console.WriteLine("Got a certificate for fiddler2.com. We'll say this is also good for any other site, like https://fiddlertool.com.");
                    e.ValidityState = CertificateValidity.ForceValid;
                }
            }
        }
Ejemplo n.º 6
0
 private void FiddlerApplication_OnValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e)
 {
     if (SslPolicyErrors.None == e.CertificatePolicyErrors)
     {
         return;
     }
     // This endpoint uses an invalid certificate, we need to let it slide
     // Required for most images to load properly
     if (e.Session.HostnameIs("kanzashi-wup.cdn.nintendo.net"))
     {
         e.ValidityState = CertificateValidity.ForceValid;
         logRequest(e.Session, "Force forwarded request.");
     }
 }
Ejemplo n.º 7
0
 private void ftp_ValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e)
 {
     e.IsCertificateValid = true;
 }
Ejemplo n.º 8
0
 private static void FiddlerApplication_OnValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e)
 {
     if (e.CertificatePolicyErrors == System.Net.Security.SslPolicyErrors.None)
     {
         return;
     }
     e.ValidityState = CertificateValidity.ForceValid;
 }
Ejemplo n.º 9
0
 private void OnValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e)
 {
     // Ignore cert errors for the made up report host.
     e.ValidityState = (e.ExpectedCN == reportHost) ? CertificateValidity.ForceValid : e.ValidityState;
 }