【发布时间】:2017-07-24 16:27:33
【问题描述】:
----简介----
我在运行以下命令时遇到了诸如“警告:SSL 错误”之类的问题: wkhtmltopdf -B 0 -L 0 -R 0 -T 0 --javascript-delay 1000 --no-stop-slow-scripts --debug-javascript test.html output.pdf
请注意,上面的 test.html 通过 ssl / 反向代理运行了一些 javascript。因此 SSL 错误..
---- 命令 CURL,测试阶段 ----
CURL 命令测试我的证书(没有证书):
curl https://prod
输出:
curl: (60) SSL certificate problem: self signed certificate
CURL 命令测试我的证书(带证书):
curl https://prod --cacert cert.crt
输出:
<MY INDEX PAGE>
Takeway :现在我知道我遇到的问题与我的远程机器证书是自签名的有关,我应该能够运行我的 wkhtmlpdf 命令(假设我可以将我的证书作为参数传递)。
----工具WKHTML,实施阶段----
我当前使用的构建版本是 0.12.4(正式版)。它不包括 ssl 证书支持,因此我有 2 个选项:
选项 1:我等到正式版本发布 (0.12.5),并在推特上发布:https://twitter.com/DeepCashkette/status/889491206673223681+
选项 2:我使用较新且可能不稳定的版本 (wkhtmltopdf 0.13.0-alpha-7b36694)。
我选择了选项 2,下载了 wkhtmltox-0.13.0-alpha-7b36694_linux-precise-i386.deb 并安装了 xvfb(对于 wkhtmlX 的 alpha 版本是必需的)。程序在这里:wkhtmltopdf: cannot connect to X server
我最终得到了这个脚本“wkhtmltopdf.sh:
xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf --ssl-crt-path cert.crt "$@"
但它仍然输出:Unknown long argument --ssl-crt-path,我无法继续进行(pdf)转换。
如果您需要更多技术细节,请告诉我,谢谢!
【问题讨论】:
标签: ssl https ssl-certificate wkhtmltopdf