SSL client authentication support in phantomjs

This commit: support for SSL client authentication ... tells us that there is a certificate flag to play with ...

My attempt:

phantomjs main.js \ --ssl-protocol=any \ --ssl-client-certificate-file=/tmp/joppli/data/certificate/certificado.crt \ --ssl-client-key-file=/tmp/joppli/data/certificate/certificado.key \ --ssl-client-key-passphrase=foobar \ --web-security=false 

No matter what I try, I cannot access the page. I get:

 page.onLoadFinished arguments[0] = "fail" 

Is the above command correct? Why does this fail? How can I debug errors? ( fail message leaves much to be desired)

The page I'm trying to access is: https://www.sedecatastro.gob.es/
Without ssl: http://www.sedecatastro.gob.es/ it works fine though.

However, I cannot access some parts of this web page without a special certificate:

+7
ssl phantomjs
source share
1 answer

The HTTPS version of the site does not provide the entire TLS certificate chain, which causes phantomjs to fail in the untrusted certificate. Try adding --ignore-ssl-errors=true to your command line and see if this works. If so, the correct solution would be to download an intermediate CA certificate, and then tell phantomjs to trust it --ssl-certificates-path=/path/to/ca.pem .

The required certificate is available at https://ssl-tools.net/certificates/ec503507b215c4956219e2a89a5b42992c4c2c20.pem , and further diagnostics are available at https://www.ssllabs.com/ssltest/analyze.html?d=sedecatastro.gob.es

+1
source share

All Articles