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

How to install Root CA to puppeteer's chromium? #219

Open
jedie opened this issue Nov 13, 2019 · 2 comments
Open

How to install Root CA to puppeteer's chromium? #219

jedie opened this issue Nov 13, 2019 · 2 comments

Comments

@jedie
Copy link

jedie commented Nov 13, 2019

A simple mkcert -install isn't enough to "inject" the Root CA to Chromium from puppeteer.

Anybody have any good advice?

EDIT: Note: I run puppeteer in docker, maybe this is the problem. Whatever. The problem is that ~/.pki/nssdb doesn't exist. So i came to this work-a-round:

mkdir -p $HOME/.pki/nssdb
certutil -d sql:$HOME/.pki/nssdb -N --empty-password
/root/bin/mkcert -install

And now, the Chromium called via puppeteer can verify the ssl certificates and '--ignore-certificate-errors' is not needed, any more.

@radum
Copy link

radum commented Mar 18, 2021

@jedie When you say you did that workaround, you mean in your docker file, or on the host machine?

@masterzen
Copy link

masterzen commented Aug 26, 2021

In my own case, the workaround wasn't working, until I found out that chromium tries to open the NSS db at /tmp/.pki/nssdb instead of ~/.pki/nssdb.

Since mkcert -install assumes .pki/nssdb to be anchored to $HOME it can be fixed with this modification:

HOME=/tmp /root/bin/mkcert -install

macbre added a commit to macbre/phantomas that referenced this issue Jun 13, 2022
macbre added a commit to macbre/phantomas that referenced this issue Jun 13, 2022
macbre added a commit to macbre/phantomas that referenced this issue Jun 13, 2022
macbre added a commit to macbre/phantomas that referenced this issue Jun 14, 2022
* Update test/ssl-certificate/generate.sh and update the tests README on how to set up mkcert

* CI: install and set up mkcert (#1143)

* Fix a typo

* CI: remove ignore-ssl-errors flags

* mkcert: make it work with puppeteer (see FiloSottile/mkcert#219)

* jest: decrease thresholds as we no longer test ignore-ssl-errors flag

* Container CI: run just a CLI script

Instead of the entire tests suite
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

3 participants