maxdachs maxdachs - 1 year ago 251
PHP Question

PHP PhantomJS ignoring SSL certificate

I want to parse a HTTPS webpage, but it's blank when I do it.
So I think it has something to do with the SSL certificate.
How can I ignore this?

I'm using php-phantomjs.

Answer Source

As seen in the question PhantomJS failing to open HTTPS site, you may need to add the following commandline options to fix SSL/TLS problems:

phantomjs --ssl-protocol=any --ignore-ssl-errors=true --web-security=false script.js

The usage in php-phantomjs is a little different, but you can use either:

$client = Client::getInstance();

or load a config.json file like that:



    "sslProtocol": "any",
    "ignoreSslErrors": true,
    "webSecurityEnabled": false
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download