question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Puppeteer Does Not Pass CA File Configs when Downloading Chromium

See original GitHub issue

I am attempting to download Chromium as part of the puppeteer install process with PUPPETEER_DOWNLOAD_HOST set to my organization’s Artifactory server. The server has a self-signed certificate. After setting NODE_EXTRA_CA_CERTS to a valid PEM file I was able to install pupeteer, but Chromium failed. So, I consulted the following articles:

https://github.com/puppeteer/puppeteer/issues/1994

https://stackoverflow.com/questions/9626990/receiving-error-error-ssl-error-self-signed-cert-in-chain-while-using-npm/35510347#35510347

https://docs.microsoft.com/en-us/windows-hardware/drivers/install/trusted-publishers-certificate-store

After following all the suggestions in the issue threads above, I continue to see the issue of Chromium failing to download because of the self-signed certificate.

Perhaps the CA file configurations are not respected when attempting to download Chromium.

Steps to reproduce

Tell us about your environment:

  • Puppeteer version: 2.0.0
  • Platform / OS version: Win 10 Version 1809 (OS Build 17763.973)
  • URLs (if applicable):
  • Node.js version: v12.14.1

What steps will reproduce the problem?

Please include code that reproduces the issue.

  1. Set PUPPETEER_DOWNLOAD_HOST
  2. Set NODE_EXTRA_CA_CERTS and/or CAFILE to a valid CER or PEM file
  3. Run NPM install

What is the expected result?

Installation of Puppeteer and appropriate Chromium revision for Puppeteer version.

What happens instead?

The following error:

puppeteer@2.0.0 install [Path to project folder]\node_modules\puppeteer node install.js

ERROR: Failed to download Chromium r706915! Set “PUPPETEER_SKIP_CHROMIUM_DOWNLOAD” env variable to skip download. Error: self signed certificate in certificate chain at TLSSocket.onConnectSecure (_tls_wrap.js:1321:34) at TLSSocket.emit (events.js:223:5) at TLSSocket._finishInit (_tls_wrap.js:794:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:608:12) – ASYNC – at BrowserFetcher.<anonymous> ([Path to project folder]\node_modules\puppeteer\lib\helper.js:111:15) at Object.<anonymous> ([Path to project folder]\node_modules\puppeteer\install.js:62:16) at Module._compile (internal/modules/cjs/loader.js:955:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:991:10) at Module.load (internal/modules/cjs/loader.js:811:32) at Function.Module._load (internal/modules/cjs/loader.js:723:14) at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10) at internal/main/run_main_module.js:17:11 { code: ‘SELF_SIGNED_CERT_IN_CHAIN’ } npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! puppeteer@2.0.0 install: node install.js npm ERR! Exit status 1

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:9
  • Comments:6

github_iconTop GitHub Comments

2reactions
ElijahLynncommented, Nov 19, 2020

I do see that in https://github.com/puppeteer/puppeteer/issues/1994#issuecomment-367153013 and https://stackoverflow.com/questions/9626990/receiving-error-error-ssl-error-self-signed-cert-in-chain-while-using-npm/35510347#35510347 it says that we have to add the below to /etc/environment:

NODE_EXTRA_CA_CERTS=/etc/pki/ca-trust/source/anchors/yourCer‌​ts.pem

I think the key here is to set it in the /etc/environment file, which I never tried before. We will try this tomorrow and report back.

0reactions
stale[bot]commented, Sep 29, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Failed to launch the browser process puppeteer
What works for me was to download chromium manually sudo apt-get install ... const browser = await puppeteer.launch({ args: ["--no-sandbox", ...
Read more >
Running puppeteer headless with extensions in docker
For a lot of scenarios you can run puppeteer, which wraps Chrome, using Chrome's headless mode. That way you won't see a browser...
Read more >
puppeteer - npm
Puppeteer is a Node.js library which provides a high-level API to control Chrome/Chromium over the DevTools Protocol.
Read more >
Understanding Self-Signed Certificate in Chain Issues on ...
I worked for a company that has a hard Information Security policy. ... npm config set cafile /path/to/your/cert.pem --global ...
Read more >
How do I deal with NET:ERR_CERT_AUTHORITY_INVALID ...
Import the generated file into Chrome; go to Chrome > Settings > Search for "SSL" > Manage Certificates > Authorities > * import...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found