コード例 #1
0
 private void CertificateValidationHandler(object sender, ValidateServerCertificateEventArgs e)
 {
     lock (ServerCertificates)
     {
         var key = Tuple.Create(e.Session.host, e.Session.port);
         if (!ServerCertificates.ContainsKey(key))
         {
             ServerCertificates.Add(key, Tuple.Create(new X509Chain(e.ServerCertificateChain.ChainContext), new X509Certificate2(e.ServerCertificate)));
         }
     }
 }
コード例 #2
0
        internal static void CheckOverrideCertificatePolicy(Session oS, string sExpectedCN, X509Certificate ServerCertificate, X509Chain ServerCertificateChain, SslPolicyErrors sslPolicyErrors, ref CertificateValidity oValidity)
        {
            EventHandler <ValidateServerCertificateEventArgs> onValidateServerCertificate = FiddlerApplication.OnValidateServerCertificate;

            if (onValidateServerCertificate == null)
            {
                return;
            }
            ValidateServerCertificateEventArgs validateServerCertificateEventArgs = new ValidateServerCertificateEventArgs(oS, sExpectedCN, ServerCertificate, ServerCertificateChain, sslPolicyErrors);

            onValidateServerCertificate(oS, validateServerCertificateEventArgs);
            oValidity = validateServerCertificateEventArgs.ValidityState;
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: emeroglu/fiddler.snippet
 private static void FiddlerApplication_OnValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e)
 {
 }
コード例 #4
0
 internal static void CheckOverrideCertificatePolicy(Session oS, string sExpectedCN, X509Certificate ServerCertificate, X509Chain ServerCertificateChain, SslPolicyErrors sslPolicyErrors, ref CertificateValidity oValidity)
 {
     EventHandler<ValidateServerCertificateEventArgs> onValidateServerCertificate = OnValidateServerCertificate;
     if (onValidateServerCertificate != null)
     {
         ValidateServerCertificateEventArgs e = new ValidateServerCertificateEventArgs(oS, sExpectedCN, ServerCertificate, ServerCertificateChain, sslPolicyErrors);
         onValidateServerCertificate(oS, e);
         oValidity = e.ValidityState;
     }
 }
コード例 #5
0
 internal void OnOnValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e)
 {
     EventHandler<ValidateServerCertificateEventArgs> handler = OnValidateServerCertificate;
     if (handler != null) handler(this, e);
 }