A
A
Artemio Vegas2017-03-22 11:00:11
Digital certificates
Artemio Vegas, 2017-03-22 11:00:11

How to use phantomjs and client ssl certificate?

Need help.
I need to access an internal corporate website secured with a client ssl certificate. I'm using phantomjs 2.1.
The developers of this site have generated a certificate and a key, I run phantomjs with the following parameters:

phantomjs --ssl-client-certificate-file=C:\tmp\clientcert.cer 
          --ssl-client-key-file=C:\tmp\clientcert.key 
          --ssl-client-key-passphrase=1111 
          --ignore-ssl-errors=true 
          C:\tmp\test.js

The result is the following error Network - Resource request error: QNetworkReply::Net
workError(SslHandshakeFailedError) ( "SSL handshake failed" )
Tried adding options --web-security=false, --ssl-protocol=any but the same, in what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artemio Vegas, 2017-04-05
@ArtemioVegas

As a result, I was simply inattentive, I missed that my certificate extension is not ".cer", but ".crt" i.e. in my case it looked like this:

phantomjs --ssl-client-certificate-file=C:\tmp\clientcert.crt 
          --ssl-client-key-file=C:\tmp\clientcert.key           
          --ignore-ssl-errors=true 
          C:\tmp\test.js

link to PhantomJs documentation phantomjs.org/api/command-line.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question