1

---- Introduction ----

I was getting issues such as 'Warning : SSL Errors' while running the following command : wkhtmltopdf -B 0 -L 0 -R 0 -T 0 --javascript-delay 1000 --no-stop-slow-scripts --debug-javascript test.html output.pdf

Note that the above test.html runs some javascript over ssl / reverse proxy. Hence the SSL Errors..

---- Command CURL, Testing Phase ----

CURL command to test my certificate (without certificate) :

curl https://prod

Output :

curl: (60) SSL certificate problem: self signed certificate

CURL command to test my certificate (with certificate) :

curl https://prod --cacert cert.crt

Output :

<MY INDEX PAGE>

Takeway : Now I know the issue I have is to do with my remote machine certificate being selfsigned, I should be able to run my wkhtmlpdf command (assuming I can pass my certificate as an argument).

---- Tool WKHTML, Implementation Phase ----

The current build version I use is 0.12.4 (official release). It does not include ssl certificates support, so from there I have 2 options :

I've opted for option 2, and downloaded wkhtmltox-0.13.0-alpha-7b36694_linux-precise-i386.deb and installed xvfb (required for alpha versions of wkhtmlX). Procedure here : wkhtmltopdf: cannot connect to X server

I end up with this script "wkhtmltopdf.sh:

xvfb-run -a -s "-screen 0 640x480x16" wkhtmltopdf --ssl-crt-path cert.crt "$@"

However it still outputs : Unknown long argument --ssl-crt-path, and I cannot proceed to the (pdf) conversion.

Let me know should you need more technical details, Thanks!

user2567674
  • 171
  • 1
  • 3
  • 15

1 Answers1

0

First of all, I see no question.

Your test and implementation phases are inconsistent :

  • curl --cacert is for server CA certificate
  • wkhtmltopdf --ssl-crt-path is for client certificate

wktmltopdf ignores self-signed certificates since v0.3, so except a warning you don't need to pass any parameter in order to make wktmltopdf generate a pdf from your host.

McX
  • 1,296
  • 2
  • 12
  • 16