ChromeDriver only opens sites with valid SSL certificates

There are two instances of the same site, the only difference is that one uses a valid one, the other uses an invalid HTTPS/SSL certification . I tried to open both in the headless ChromeDriver 2.31 and found that it only opens the site with a valid SSL certificate.

 <chromepath> --headless --remote-debugging-port=9101 --disable-gpu <siteurl> 

The code above opens the site https://chrome-devtools-frontend.appspot.com/serve_file/identification_number with a preview from this website.

I use this to ignore certificate issues, but I get the same blank page for this site in ChromeDriver .

 caps.setCapability("chrome.switches", Arrays.asList("--ignore-certificate-errors")); 
+7
ssl ssl-certificate webdriver selenium-chromedriver
source share
1 answer

you can use DesiredCapabilities

 DesiredCapabilities handlSSLErr = DesiredCapabilities.chrome (); handlSSLErr.setCapability (CapabilityType.ACCEPT_SSL_CERTS, false); WebDriver driver = new ChromeDriver (handlSSLErr); 

Try it, maybe it will help you.

The second way:

 System.setProperty("webdriver.chrome.driver", "E:\\software and tools\\chromedriver_win32\\chromedriver.exe"); ChromeOptions option= new ChromeOptions(); option.addArguments("headless"); option.addArguments("ignore-certificate-errors"); WebDriver d=new ChromeDriver(option); //d.get("http://expired.badssl.com/"); d.get("https://expired.badssl.com/"); 

Image for reference enter image description here

+1
source share

All Articles