1

I am having problems with pages with SSL. I'm pretty sure this is the problem because I can go to http pages and get the full page source, but when I go to an https address, I get the following:

<html><head></head><body></body></html>

I am using:

  • PhantomJS v. 1.9.1
  • GhostDriver v. 1.0.3
  • Java 1.7

I have tried setting --ignore-ssl-errors=true on desired capabilities, but it doesn't seem to be working.

public WebDriver createDriver(DesiredCapabilities dcaps) {
    dcaps.setCapability(
        PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
        "target/classes/phantomjs.exe");
    String [] phantomJsArgs = {"--ignore-ssl-errors=true"};
    dcaps.setCapability(
        PhantomJSDriverService.PHANTOMJS_GHOSTDRIVER_CLI_ARGS, 
        phantomJsArgs);
    return new PhantomJSDriver(dcaps);
}

I have also tried this with "PhantomJSDriverService.PHANTOMJS_CLI_ARGS" and with the cli argument "--web-security=false" added. In all cases, I can see something like the following in the console, but none seem to actually work.

DEBUG: org.apache.http.wire -  >> "{"desiredCapabilities":{
"loggingPrefs":{"driver":"FINEST"},"cssSelectorsEnabled":true,
"javascriptEnabled":true,"phantomjs.ghostdriver.cli.args":["--ignore-ssl-errors=true"],
"phantomjs.binary.path":"target/classes/phantomjs.exe",
"takesScreenshot":true}}"

Any ideas would be greatly appreciated.

mgates2
  • 85
  • 1
  • 8
  • possible duplicate of [PhantomJS failing to open HTTPS site](http://stackoverflow.com/questions/12021578/phantomjs-failing-to-open-https-site) – Artjom B. Jan 27 '15 at 16:40

1 Answers1

1

This seems to have been a bug with PhantomJS 1.9.1 and was fixed in version 1.9.8. I was able to resolve this issue by upgrading to the newer driver.

Answer found via this bug report: https://github.com/ariya/phantomjs/issues/12655

mgates2
  • 85
  • 1
  • 8