There are two instances of the same site, only difference is, that one uses a valid, another one uses an invalid HTTPS/SSL certification
. I tried to open both in headless ChromeDriver 2.31
and found it opens site only with valid SSL
certification.
<chromepath> --headless --remote-debugging-port=9101 --disable-gpu <siteurl>
Code above opens a site https://chrome-devtools-frontend.appspot.com/serve_file/identification_number with a preview from the given website.
I use this to ignore certificate problems, but I get the same blank page for this site in ChromeDriver
.
caps.setCapability("chrome.switches", Arrays.asList("--ignore-certificate-errors"));
Late to the party, maybe it is useful to someone, the below parameter works for me.
acceptInsecureCerts: true
you can use DesiredCapabilities
DesiredCapabilities handlSSLErr = DesiredCapabilities.chrome ();
handlSSLErr.setCapability (CapabilityType.ACCEPT_SSL_CERTS, false);
WebDriver driver = new ChromeDriver (handlSSLErr);
Try it, may be it helps you.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With