简体   繁体   中英

Safari . How to ignore error Incorrect TLS certificate

I use Selenium Web Driver. My capabilities

  this.desiredCapabilities = new DesiredCapabilities();
        this.desiredCapabilities.setCapability("enableVNC", true);
        this.desiredCapabilities.setCapability("enableVideo", false);
        this.desiredCapabilities.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS, true);
        this.desiredCapabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
        this.desiredCapabilities.setCapability(ChromeOptions.CAPABILITY, this.chromeOptions);
        this.desiredCapabilities.setCapability("sessionTimeout", "15m");

When desktop Safari browser try to open the page by HTTPS, an error occurs "Incorrect TLS certificate...Failed to load Do you want to continue ignoring the TLS errors? YES/NO"

How I can ignore this behavior for all web pages? This behavior does not occur for other browsers (Chrome/Firefox/Edge).

the following guides did not help: https://www.browserstack.com/docs/automate/selenium/accept-insecure-certificates https://www.toolsqa.com/selenium-webdriver/ssl-certificate-in-selenium/

It seems that Safari tighten up the security policy by removing options that are considered as insecure.

So, frankly spoken, if you try to fix your issue with a workaround or 'dirty hack' you just postpone it to a later date and browser version. The only way out is IMHO to get things done the right way and solve the problem.

Request a new certificate from a official Certification Authority if you need public access to your server or set up your own CA to get rid of the 'self-signed certificate' trap.

Seting up a CA is not the big thing. Ther is a lot of free/open-source and commercial tools available so you can choose one that fits best your needs.

Creating your root and server certificate is done in no time. Installing the new certificate in the server is a bit more because you have a downtime. And last but not least your own root certificate must be installed in the browsers truststore for user certificates. But that's also a easy task.

The benefit of this way is that you are done even if you update your browser.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM