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

SSL Certificate error: ERR_CERT_AUTHORITY_INVALID on certain sites #1137

Closed
sradu opened this issue Oct 23, 2017 · 16 comments
Closed

SSL Certificate error: ERR_CERT_AUTHORITY_INVALID on certain sites #1137

sradu opened this issue Oct 23, 2017 · 16 comments

Comments

@sradu
Copy link

sradu commented Oct 23, 2017

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!

@aslushnikov
Copy link
Contributor

Can't reproduce this on current tip-of-tree: 0.13.0-alpha. Could you please check if it works for you on tip-of-tree?

@sradu
Copy link
Author

sradu commented Oct 25, 2017

I'm afraid it's still happening with tip-of-tree.

@sjungwirth
Copy link

I'm running into same issue on another domain. The test script above fails for me as well.

@aslushnikov
Copy link
Contributor

@sjungwirth can you share your script/domain?

@sradu
Copy link
Author

sradu commented Oct 25, 2017

It might be related to Comodo certificates.

@sjungwirth
Copy link

@aslushnikov I verified using the same script in the original post #1137 (comment) against www.frys.com

@bondden
Copy link

bondden commented Nov 1, 2017

Also confirm the same problem for Let's Encrypt certificate at itms.pro
It works without errors with headless:false

@hellosze
Copy link

hellosze commented Nov 6, 2017

Seeing errors for this site. http://www.wmcactionnews5.com/ .
Also used headless:false.

(node:71693) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: SSL Certificate error: ERR_CERT_COMMON_NAME_INVALID
(node:71693) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
^C(node:71693) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Page crashed!

@sradu
Copy link
Author

sradu commented Nov 13, 2017

I stopped getting errors in the latest Chromium revision. Can anyone else on this issue please confirm? If all is well I'll close this issue.

@wenJanus
Copy link

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

@aslushnikov
Copy link
Contributor

@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.

@azohra
Copy link

azohra commented Feb 9, 2018

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

@elhigu
Copy link

elhigu commented Feb 19, 2018

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

@beerendlauwers
Copy link

beerendlauwers commented Mar 14, 2018

@tk8817 We had success with setting Security.setIgnoreCertificateErrors (https://chromedevtools.github.io/devtools-protocol/tot/Security#method-setIgnoreCertificateErrors) on Chrome 65.0.3325.146.

More context: https://gitlab.com/DMore/chrome-mink-driver/issues/57

@FullStackAlex
Copy link

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

@chrisburkejr
Copy link

@tech-nomad Does anyone know why this has to be slowMo set to 250. In the docs it says this is for slowing down puppeteer actions but doesn't look like it should be in production code.
https://developers.google.com/web/tools/puppeteer/debugging

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