puppeteer: SSL Certificate error: ERR_CERT_AUTHORITY_INVALID on certain sites

Running this script in a Debian environment returns:

(node:7395) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: SSL Certificate error: ERR_CERT_AUTHORITY_INVALID

const puppeteer = require('puppeteer');

args = [];
args.push('--no-sandbox');
args.push('--disable-setuid-sandbox');

const takeSnapshot = async (page) => {
  await page.screenshot({ path: '/tmp/test.png' });
};

try {
  (async () => {
    browser = await puppeteer.launch({
      headless: true,
      args,
    });

    page = await browser.newPage();

    await page.goto('about:blank', { waitUntil: 'load' });

    await page.goto('https://www.ralphlauren.com/women-clothing-polo-shirts/skinny-fit-big-pony-polo-shirt/412481.html?cgid=women-clothing-polo-shirts&dwvar412481_colorname=Deep+Royal&webcat=women/tops/Polo+Shirts', { waitUntil: 'load' });

    await takeSnapshot(page);
  })();
} catch (err) {
  console.log(err);
}

There are other sites as well. Is it because of system certificates?

Thank you!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 5
  • Comments: 16 (3 by maintainers)

Most upvoted comments

I’ve got it working with: browser = await puppeteer.launch({ headless: false, slowMo: 250, ignoreHTTPSErrors: true });

@tk8817 @aslushnikov the option seems to be ignoreHTTPSErrors not ignoreHTTPErrors

@wenJanus it looks like you’re using self-signed certificates on the localhost. Using ignoreHTTPErrors puppeteer option should help to get rid of this message.

Can I ask why this issue was closed? I don’t see any solution and can still reproduce the issue using the submitters attached code example. We are seeing the same issue with our websites.

The ignoreHTTPErrors flag does not seem to effect the outcome. Is the behaviour by chance related to this Headless Chrome bug? https://bugs.chromium.org/p/chromium/issues/detail?id=721739

I have the same problem.

09:24:07.722 DEBUG selenium-nodejs.HomePage: navigate [1120/092408.090:VERBOSE1:network_delegate.cc(31)] NetworkDelegate::NotifyBeforeURLRequest: https://localhost/home [1120/092408.403:VERBOSE1:navigator_impl.cc(242)] Failed Provisional Load: https://localhost/home, error_code: -501, error_description: , showing_repost_interstitial: 0, frame_id: 1

The error page like: image