This is a migrated thread and some comments may be shown as answers.

Auto ignore certificate errors and DON'T proceed

3 Answers 2005 Views
FiddlerCore
This is a migrated thread and some comments may be shown as answers.
Steven
Top achievements
Rank 1
Steven asked on 09 Jan 2018, 05:05 PM

Every time Fiddler encounters a certificate error it prompts me on whether to ignore the error and proceed or not.

I know I can go into Tools --> Options --> HTTPS --> and check Ignore Server Certificate errors (unsafe) - but that is the opposite of what I want to do.

 

I want to NOT proceed for all certificate errors without being prompted. Is there a way to accomplish this?

For various reasons in our environment I encounter a lot of certificate errors and I never want to proceed on them and clicking "No" through dozens of ignore certificate error? is tiresome.

3 Answers, 1 is accepted

Sort by
0
Accepted
Simeon
Telerik team
answered on 15 Jan 2018, 06:35 PM
Hello,

You could use the FiddlerScript to attach to the FiddlerApplication.OnValidateServerCertificate event.

For example, in the Main method of your FiddlerScript you could add the following code:
FiddlerApplication.OnValidateServerCertificate += (sender, ea) =>
{
    if(ea.CertificatePolicyErrors != SslPolicyErrors.None)
    {
        ea.ValidityState = CertificateValidity.ForceInvalid;
    }
};

This is just an example how to set the ValidityState. Of course, you could use your own business rules for this.

Regards,
Simeon
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Steven
Top achievements
Rank 1
answered on 02 Feb 2018, 11:14 PM
worked like a charm. thanks.
1
Jon
Top achievements
Rank 1
answered on 06 May 2020, 12:17 AM

If you are in the fiddler script window, you want:

 

static function ValidateCert(sender, ea: ValidateServerCertificateEventArgs)
{
if(ea.CertificatePolicyErrors != System.Net.Security.SslPolicyErrors.None)
{
ea.ValidityState = CertificateValidity.ForceInvalid;
}
}

    static function Main() {
        ...  
FiddlerApplication.add_OnValidateServerCertificate(ValidateCert);
    }

Tags
FiddlerCore
Asked by
Steven
Top achievements
Rank 1
Answers by
Simeon
Telerik team
Steven
Top achievements
Rank 1
Jon
Top achievements
Rank 1
Share this question
or