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))); } } }
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; }
private static void FiddlerApplication_OnValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e) { }
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; } }
internal void OnOnValidateServerCertificate(object sender, ValidateServerCertificateEventArgs e) { EventHandler<ValidateServerCertificateEventArgs> handler = OnValidateServerCertificate; if (handler != null) handler(this, e); }