Coder Social home page Coder Social logo

How to ignore HTTPS certificate errors when using AtataContext.GlobalConfiguration.AutoSetUpConfiguredDriversAsync() about atata-webdriversetup HOT 5 CLOSED

atata-framework avatar atata-framework commented on August 29, 2024
How to ignore HTTPS certificate errors when using AtataContext.GlobalConfiguration.AutoSetUpConfiguredDriversAsync()

from atata-webdriversetup.

Comments (5)

YevgeniyShunevych avatar YevgeniyShunevych commented on August 29, 2024

Can you try to add the following line to your global setup method before the AtataContext configuration:

ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;

If it works for you, I will think about the cleaner solution to add to Atata.WebDriverSetup library.

from atata-webdriversetup.

mamift avatar mamift commented on August 29, 2024

Unfortunately no this didn't work:
image

What's weird is that this worked in version 1.x perfectly fine. I was using Atata.WebDriverSetup 1.2.0 and also Atata 1.12.0 where it worked.

Edit: I also experimented with adding the ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true; line in a static constructor method, so it get's called before even SetupFixture was instantiated, but still no luck.

from atata-webdriversetup.

YevgeniyShunevych avatar YevgeniyShunevych commented on August 29, 2024

I believe that it happens because of CheckCertificateRevocationList property of HttpClientHandler, which became enabled by default in Atata.WebDriverSetup v2.0.0. Let's try to disable it, which is now possible with the latest v2.6.0 release. So please update the Atata.WebDriverSetup package to the latest version. Then you can try one of the code blocks, again in global setup method before the AtataContext configuration.

DriverSetup.GlobalConfiguration
    .WithCheckCertificateRevocationList(false);

or

DriverSetup.GlobalConfiguration
    .WithCheckCertificateRevocationList(false)
    .WithHttpClientHandlerConfiguration(x => x.ServerCertificateCustomValidationCallback += (_, _, _, _) => true);

And you can remove ServicePointManager.ServerCertificateValidationCallback += ... code.

from atata-webdriversetup.

mamift avatar mamift commented on August 29, 2024

Thank you - I can confirm that:

DriverSetup.GlobalConfiguration .WithHttpClientHandlerConfiguration(x => x.ServerCertificateCustomValidationCallback += (_, _, _, _) => true);

resolves the issue for me. DriverSetup.GlobalConfiguration.WithCheckCertificateRevocationList(false); had no effect.

from atata-webdriversetup.

YevgeniyShunevych avatar YevgeniyShunevych commented on August 29, 2024

You are welcome. Thanks for letting know which method solved the issue.

from atata-webdriversetup.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.