1

When running code:

PhantomJsDriverManager.getInstance().forceCache().setup();

Or:

PhantomJsDriverManager.getInstance().setup();

I get a certificate exception when the driver is being downloaded:

java.lang.RuntimeException: javax.net.ssl.SSLPeerUnverifiedException: Host name 'bbuseruploads.s3.amazonaws.com' does not match the certificate subject provided by the peer (CN=*.s3.amazonaws.com, O=Amazon.com Inc., L=Seattle, ST=Washington, C=US)
    at io.github.bonigarcia.wdm.BrowserManager.manage(BrowserManager.java:262)
    at io.github.bonigarcia.wdm.BrowserManager.setup(BrowserManager.java:765)
    at io.github.bonigarcia.wdm.BrowserManager.setup(BrowserManager.java:725)

This also happens for other drivers like OperaDriverManager and FirefoxDriverManager

I tested:

  • io.github.bonigarcia webdrivermanager 1.6.2
  • io.github.bonigarcia webdrivermanager 1.7.0

This certificate problem is probably out of control for the plugin.

My question is: How can I ensure the downloads always work? Can I add the browser driver downloads to my local Maven Nexus repository to avoid such problems causing my builds to fail?

Or do I need to setup a local webserver and adapt the webdrivermanager.properties file and adapt: wdm.phantomjsDriverUrl=https://bitbucket.org/ariya/phantomjs/downloads/ wdm.phantomjsDriverTaobaoUrl=http://npm.taobao.org/mirrors/phantomjs

1 Answer 1

1

You can download manually the binary and store it in the place where WebDriverManager is going to look for it. In the case of PhantomJS, and supposing you want to use version 2.5.0, that place is:

~/.m2/repository/webdriver/phantomjs/<plaform>/2.5.0

For example, for Windows:

C:/Users/your-user/.m2/repository/webdriver/phantomjs/windows/2.5.0/phantomjs.exe

... or for Linux (Ubuntu Xenial):

/home/your-user/.m2/repository/webdriver/phantomjs/linux-ubuntu-xenial-x86_64/2.5.0/phantomjs

After that, you can force to use it using the method forceCache():

PhantomJsDriverManager.getInstance().forceCache().setup();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.