Client certificate for wkhtmltopdf

Hello I ve tried to secure my public erp instance with a client certificate.
Erpnext is running behind a reverse proxy.
Nearly everything is working as expected, ecxept wkhtmltopdf.

Everytime I try to create a PDF I got a long error message.
Short I am sure that wkhtmltopdf ist trying to access erpnext an does not have a certificate.

How can I add the client certificat to wkhtmltopdf or is there a way to bypass the reverse proxy. Because it is an internal process

thanks a lot

Hi @shb:

Try to set this on your site_config.json
"host_name":"https://yoursite.com"

Hope this helps.

1 Like

I have the same problem.
But i am using the frappe_docker deployment with a lightly modified pwd.yml.
The thing is running behind a https-portal Reverse-Proxy ebcause of the SSL certificates.
The problem is now, that the pdf geberation looks broken.
The only progress i had (change of the error message) was when setting the host_name to 127.0.0.1:8000 (this is the backend-part of the deployment.
But there are still problems:

frappe.exceptions.ValidationError: PDF-Generierung ist aufgrund fehlerhafter Verknüpfungen für Bilddateien fehlgeschlagen

Though there are no Images in the report. :frowning:

I have no solution, and it is a showstopper.

The proper way to set it up is to set host_name to the same value as the domain name you are using in your SSL certificate, for example, “https://hostname.domain.tld

You can do this with the bench set-url-root command. No need to edit the file manually.

Now i have the problem still existing, though i have set the host_name to the correct value.
I can try all variants with http:// or https:// or solo, only the url, it still brings the error “frappe.exceptions.ValidationError: PDF-Generierung ist aufgrund fehlerhafter Verknüpfungen für Bilddateien fehlgeschlagen”
It is still a showstopper.
I think it is not the issue, because there is an instance, where it is working without the host_name. I dont know a solution to this…

Do you have the right version of wkhtmltopdf? Try this command:

wkhtmltopdf -V

Output should be:

wkhtmltopdf 0.12.6.1 (with patched qt)