Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error: self-signed certificate" when using references to internal webserver hosting css and js files #104

Open
NoraTheExplorer opened this issue Aug 10, 2023 · 0 comments

Comments

@NoraTheExplorer
Copy link

Setup:

  • local/intranet environment
  • server is only reachable within intranet
  • nodejs running a webserver with SSL
  • key.pem and cert.pem are selfsigned

Now, when using html in the header like this.
<script src="https://myserver.mydomain.local:8080/quote/dev/assets/js/vyquote.js" crossorigin="anonymous" X-Content-Type-Options="no-sniff" defer></script> <!-- defer is needed to wait with the script until the HTML is fully loaded --> <link rel="stylesheet" href="https://myserver.mydomain.local:8080/quote/dev/assets/font/gilroy-regular/stylesheet.css" crossorigin="anonymous">

I get this error when calling generatePdf(file, options):

Error: self-signed certificate at TLSSocket.onConnectSecure (node:_tls_wrap:1540:34) at TLSSocket.emit (node:events:513:28) at TLSSocket._finishInit (node:_tls_wrap:959:8) at ssl.onhandshakedone (node:_tls_wrap:743:12) { code: 'DEPTH_ZERO_SELF_SIGNED_CERT', response: undefined }

Even though I configured my options like this:
let options = { format: 'A4', preferCSSPageSize: true, printBackground: true, args: ['--no-sandbox', '--disable-setuid-sandbox', '--allow-insecure-localhost','--disable-machine-cert-request'] };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant