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

Allow to ignore certificate errors during navigation #84

Closed
aslushnikov opened this issue Jul 17, 2017 · 7 comments
Closed

Allow to ignore certificate errors during navigation #84

aslushnikov opened this issue Jul 17, 2017 · 7 comments
Labels

Comments

@aslushnikov
Copy link
Contributor

There should be a capability to ignore certificate errors during navigation. See #66 for proposal and cyrus-and/chrome-remote-interface#183 for original discussion.

For example, we can add ignoreSSL navigation option:

page.navigate('https://example.com', { ignoreSSL: true })
@paulirish
Copy link
Collaborator

naming pedantry: SSL (which is dead and now really TLS these days) is about the connection, whereas certificates are about identification. So it turns out certificate errors aren't really TLS issues. In order to simplify all this, folks normally just call the whole kit-and-kaboodle "HTTPS" which seems generally agreeable.

So I'd start with calling this ignoreHTTPSerrors, but a shorter name could be something like:pardonBadHTTPS

@aslushnikov
Copy link
Contributor Author

Thanks Paul!

I like the ignoreHTTPSErrors. Or how about ironic pardonHTTPS?

@aslushnikov
Copy link
Contributor Author

It would be troublesome to implement this per navigation; i'm leaning towards the

page.setIgnoreHTTPSErrors(true);

@Garbee
Copy link
Contributor

Garbee commented Jul 28, 2017

I'd urge it be more tedious to ignore per navigation since you really shouldn't be ignoring problems like that. Even in a test suite, it's not something to encourage.

@aslushnikov
Copy link
Contributor Author

@Garbee do you have any api suggestion?

Having the setter on the page level would allow one to ignore HTTPS errors for the renderer-initiated navigations (those initiated with javascript's window.location.href = ...), which is valuable

@Garbee
Copy link
Contributor

Garbee commented Jul 28, 2017

hmm. If the page level API solves a problem that the navigation function level doesn't, then that's the way to go. I simply didn't want to see it as "cleaner" than needing to repeat it on all the manual navigation from the puppeteer script.

aslushnikov added a commit that referenced this issue Aug 1, 2017
This patch implements Page.setIgnoreHTTPSErrors method.

Fixes #84.
@aslushnikov
Copy link
Contributor Author

More details on this.
The certificates behave a little surprising - once a certain certificate error was "ignored" via protocol's Security.handleCertificateError, the certificate would not trigger any errors in future.

This would result in inability to do Page.setIgnoreHTTPSErrors(false), which causes the test failure in the #176.

Upstream bug: https://bugs.chromium.org/p/chromium/issues/detail?id=751204. We spent half a day with @allada debugging the issue but it didn't get us anywhere.

To move on with this, since there's no practical need to do setIgnoreHTTPSErrors(false), we can have a browser option to ignore HTTPS errors:

const {Browser} = require('puppeteer');
const browser = new Browser({ignoreHTTPSErrors: true});
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants