How to install Root CA to puppeteer's chromium?
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.
@jedie When you say you did that workaround, you mean in your docker file, or on the host machine?
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