Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Self signed SSL certificates in phantomjs / selenium #358

Closed
ti2m opened this issue Oct 21, 2014 · 2 comments
Closed

Self signed SSL certificates in phantomjs / selenium #358

ti2m opened this issue Oct 21, 2014 · 2 comments

Comments

@ti2m
Copy link

ti2m commented Oct 21, 2014

Hi,
I can't seem to get self signed SSL certificates working with selenium. Phantom needs to be called with option --ignore-ssl-errors=true and this works if I start phantom myself on the command line and connect to it with wd. I can't get selenium to start phantom with these options though. Selenium runs with -trustAllSSLCertificates but that doesn't seem to be enough. WD sents

POST /session {"desiredCapabilities":{"browserName":"phantomjs","acceptSslCerts":true,"version":"","javascriptEnabled":true,"platform":"ANY"}}

but it seems to ignore acceptSslCerts as the session returned has with acceptSslCerts=false

Any clue where to look? The python binding supports service_args, couldn't find anything like it for JS. Also found the ghostdriver option (https://cdn.rawgit.com/detro/ghostdriver/master/binding/java/docs/javadoc/index.html) but I guess thats not the right place to look. If I follow https://code.google.com/p/selenium/wiki/DesiredCapabilities then acceptSslCerts should be the way to solve this, but how to set it?

Thanks for any advice.

@sebv
Copy link
Collaborator

sebv commented Oct 21, 2014

Check the Readme in the ghostdriver project, you'll find the capability you
need.

On Tuesday, October 21, 2014, Timm Jansen notifications@github.com wrote:

Hi,
I can't seem to get self signed SSL certificates working with selenium.
Phantom needs to be called with option --ignore-ssl-errors=true and this
works if I start phantom myself on the command line and connect to it with
wd. I can't get selenium to start phantom with these options though.
Selenium runs with -trustAllSSLCertificates but that doesn't seem to be
enough. WD sents

POST /session
{"desiredCapabilities":{"browserName":"phantomjs","acceptSslCerts":true,"version":"","javascriptEnabled":true,"platform":"ANY"}}

but it seems to ignore acceptSslCerts as the session returned has with
acceptSslCerts=false

Any clue where to look? The python binding supports service_args, couldn't
find anything like it for JS. Also found the ghostdriver option (
https://cdn.rawgit.com/detro/ghostdriver/master/binding/java/docs/javadoc/index.html)
but I guess thats not the right place to look. If I follow
https://code.google.com/p/selenium/wiki/DesiredCapabilities then
acceptSslCerts should be the way to solve this, but how to set it?

Thanks for any advice.


Reply to this email directly or view it on GitHub
#358.

@ti2m
Copy link
Author

ti2m commented Oct 21, 2014

Thanks for your answer, read the readme before though. It seems to be all about the format. Found an answer by accident over here, if anyone else is running into this issue angular/protractor#150 (comment):

browser.init({
  browserName: 'phantomjs', 
  'phantomjs.cli.args': ['--ignore-ssl-errors=true',  '--web-security=false']
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants