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

'ignoreHTTPSErrors' option is not working well. #3119

Closed
kbbmanse opened this issue Aug 22, 2018 · 5 comments
Closed

'ignoreHTTPSErrors' option is not working well. #3119

kbbmanse opened this issue Aug 22, 2018 · 5 comments

Comments

@kbbmanse
Copy link

kbbmanse commented Aug 22, 2018

  • Puppeteer version:1.7.0
  • Platform / OS version:mac/sierra 10.12.6
  • URLs (if applicable):
  • Node.js version:8.9.0

What steps will reproduce the problem?
test.js

const puppeteer = require("puppeteer");

async function test(browser) {
    const page = await browser.newPage();
    await page.setRequestInterception(true);

    page.on("request", request => {
        console.log("request - resource type: " + request.resourceType() + ", url: " + request.url() + ", nav: " + request.isNavigationRequest() + ", redir: " + request.redirectChain().length);
        request.continue();
    });

    page.on("response", response => {
        console.log("response - resource type: " + response.request().resourceType() + ", url: " + response.url() + ", from cache: " + response.fromCache());
    });

    try {
        await page.goto("https://inavi.com/CustCenter/Qna/Dtls/370615?catecd1=cate_00126", {waitUntil:"networkidle2"});
    } catch(e) {
        console.log(e.message);
    }
    finally {
        await page.close();
    }
}

puppeteer.launch({headless: true, dumpio: true, ignoreHTTPSErrors:false, args:['--ignore-certificate-errors', '--enable-feature=NetworkService']}).then(async browser=> {
    console.log("First Time - Set ignoreHTTPSErrors:false\n");
    await test(browser);
    const wsEndpoint = browser.wsEndpoint();
    browser.disconnect();

    console.log("\nSecond Time - Set ignoreHTTPSErrors:true\n");
    puppeteer.connect({browserWSEndpoint: wsEndpoint, ignoreHTTPSErrors:true, args:['--ignore-certificate-errors', '--enable-feature=NetworkService']}).then(async browser=> {
        await test(browser);
        browser.close();
    });
});

Results

DevTools listening on ws://127.0.0.1:51553/devtools/browser/03c1dc63-c2a5-4910-ba9c-11455c134224
First Time - Set ignoreHTTPSErrors:false

request - resource type: document, url: https://inavi.com/CustCenter/Qna/Dtls/370615?catecd1=cate_00126, nav: true, redir: 0
net::ERR_CERT_SYMANTEC_LEGACY at https://inavi.com/CustCenter/Qna/Dtls/370615?catecd1=cate_00126

Second Time - Set ignoreHTTPSErrors:true

request - resource type: document, url: https://inavi.com/CustCenter/Qna/Dtls/370615?catecd1=cate_00126, nav: true, redir: 0
Navigation Timeout Exceeded: 30000ms exceeded

What is the expected result?
There are several pages with the https certification problem.
I expected that the pages will be rendered well if I apply the option 'ignoreHTTPSErrors:true' when I invoke puppeteer.launch().

What happens instead?
As you can see in the above results, the option 'ignoreHTTPSErrors:true' was not effective at all.
The output shows that the request event has occurred, but the response event didn't occure.

@reverieline
Copy link

reverieline commented Aug 24, 2018

Same problem in headless mode. But if launch options ={
headless: false,
ignoreHTTPSErrors: true,
args: ["--ignore-certificate-errors"],
}, everything work fine.

@kbbmanse
Copy link
Author

@reverieline
Thank you for your answer. But I usually use puppeteer on headless mode because it is executed on Linux servers. So this is still problem to me..

@batt842
Copy link

batt842 commented Aug 28, 2018

I've been experiencing the same thing.
All I found was Security.certificateError, Security.handleCertificateError and Security.setOverrideCertificateErrors used to handle certificate errors are deprecated. Instead, it seems that the method Security.setIgnoreCertificateErrors has been added. I tried with this new method, but it still doesn't work.

@aslushnikov
Copy link
Contributor

This is a dupe of #1159. It's fixed now on puppeteer@next.

@rn2web
Copy link

rn2web commented Nov 4, 2021

Same problem in headless mode. But if launch options ={ headless: false, ignoreHTTPSErrors: true, args: ["--ignore-certificate-errors"], }, everything work fine.

This solution Works fine in 2021.

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

5 participants