使用 phantomjs 时出现 SSL 证书错误

Zeu*_*eus 5 ssl ssl-certificate phantomjs

我在使用 phantomjs 和 rasterize.js 时遇到问题。当我执行以下命令时:

phantomjs --ssl-protocol=any /lib/rasterize.js 'https://www.google.com' 'test.png'

我收到以下错误:

2017-10-04T08:21:05 [DEBUG] Network - SSL Error: "The issuer certificate of a locally looked up certificate could not be found"
2017-10-04T08:21:05 [DEBUG] Network - SSL Error: "The root CA certificate is not trusted for this purpose"
2017-10-04T08:21:05 [DEBUG] Network - Resource request error: QNetworkReply::NetworkError(SslHandshakeFailedError) ( "SSL handshake failed" ) URL: "https://www.google.com/"
Run Code Online (Sandbox Code Playgroud)

我可以使用--ignore--ssl-errrors=trueflag 解决它,但我不想忽略所有 SSL 错误。

知道如何解决这个问题吗?