puppeteer: Certificates error using puppeteer
Hello,
I encountered a weird ssl problem using puppeeter 1.2.0 or 1.3.0 (inside a container).
Looking at this example (works on https://try-puppeteer.appspot.com/)
const browser = await puppeteer.launch({
ignoreHTTPSErrors: true,
headless: true
});
const page = await browser.newPage();
await Promise.all([
page.waitForNavigation({timeout: 30000, waitUntil: 'networkidle2'}),
page.goto('http://www.latabledarc.com/trianon-assiette-a-pain.html')
]);
await Promise.all([
page.waitFor(5000),
page.click('#product-addtocart-button')
]);
await Promise.all([
page.waitForNavigation({timeout: 30000, waitUntil: 'networkidle2'}),
page.goto('https://www.latabledarc.com/checkout/onepage/')
]);
console.log(await page.url());
await browser.close();
The problem is that I get the following error
Error running your code. Error: net::ERR_CERT_AUTHORITY_INVALID
Instead of to be allowed to navigate on the target url.
But if I try this in my browser everything is fine. The website has a valid ssl certificate.
On my local environment I get the following message using dumpio :
0414/115606.318905:ERROR:nss_ocsp.cc(597)] No URLRequestContext for NSS HTTP handler. host: cacerts.thawte.com
[0414/115606.318962:ERROR:cert_verify_proc_nss.cc(980)] CERT_PKIXVerifyCert for www.latabledarc.com failed err=-8179
And this seems not to be the only website wich is affected by this problem.
Any clue ?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 14
- Comments: 25
Commits related to this issue
- Ignore certificate errors https://github.com/GoogleChrome/puppeteer/issues/2377 — committed to Financial-Times/n-test by debugwand 6 years ago
- feat(chromium): roll Chromium to r594312 This roll includes: - https://crrev.com/593256 - Support fetching missing intermediate certificates in headless - https://crrev.com/594161 - DevTools: allow a... — committed to aslushnikov/puppeteer by aslushnikov 6 years ago
- feat(chromium): roll Chromium to r594312 (#3310) This roll includes: - https://crrev.com/593256 - Support fetching missing intermediate certificates in headless - https://crrev.com/594161 - DevTool... — committed to puppeteer/puppeteer by aslushnikov 6 years ago
You can also set an args array inside the launch config
args: [ '--ignore-certificate-errors' ]
I have noticed that this only seems to work when headless if false.
Anyone seen a workaround for this? We’ve been banging our heads around this issue for a long while…
Error: net::ERR_SSL_VERSION_OR_CIPHER_MISMATCH at https://www.xxxxxxsolutions.com/
{headless:true, args: [ '--enable-features=NetworkService ]}
worked for meawait puppeteer.launch({ignoreHTTPSErrors: true});
I’ve raised this as an issue on https://bugs.chromium.org/p/chromium/issues/detail?id=877075 : any confirmation/example cases - feel free to add.
This worked for me
I initialised the browser as
const browser = await puppeteer.launch({headless:true, args: [ '--ignore-certificate-errors' ]});
args: [ '--ignore-certificate-errors' ]
dosn’t change anything (we are in headless). For RuslanTT as fas as we know the certificate is not present in the container so even with curl it’s impossible to connect to the website. By adding the certificate manually curl is working but not chrome this seems because chrome has his own directory for certificate, but we currently don’t know where is the directory for chrome. But for https://www.crediteurope.ch the problem seems simpler as the certificate is a 30 year lifetime certificate he is probably untrusted by chrome, see: https://security.googleblog.com/2018/03/distrust-of-symantec-pki-immediate.htmlAnyone have any workarounds? This has been killing me for months.