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

Give lighthouse an option to ignore certificate errors #559

Closed
surma opened this issue Aug 4, 2016 · 19 comments
Closed

Give lighthouse an option to ignore certificate errors #559

surma opened this issue Aug 4, 2016 · 19 comments

Comments

@surma
Copy link
Contributor

surma commented Aug 4, 2016

If people serve the site via a local webserver using a self-signed certificte (e.g. simplehttp2server 🙄), lighthouse just blocks (showing the interstitial in the Chrome instance).

@paulirish
Copy link
Member

Looked into things and I don't think it's possible to do this at runtime. (Currently at least)

There is a --ignore-certificate-errors runtime flag that would probably do the trick.

We can add that in our launcher. Extension users and other folks would be in the dust, but ... that's something.

@surma
Copy link
Contributor Author

surma commented Aug 4, 2016

There’s also chrome://flags/#allow-insecure-localhost, which would cover most situations I think. Not sure if we can control that, though.

@paulirish
Copy link
Member

we can add whatever into we want into here https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/scripts/launch-chrome.sh#L17

I'm fine with both, fwiw.

If we do this, we should log what flags we're launching chrome with so we can be clear with users on the security status.

@brendankenny
Copy link
Member

isn't launch-chrome.sh set up to pass in args, so you could just do npm run chrome -- --ignore-certificate-errors?

@wardpeet
Copy link
Collaborator

wardpeet commented Aug 5, 2016

Yes you can just run it with the extra arg . Chrome script uses the $@ which makes it possible

@paulirish
Copy link
Member

closing as we found a resolution.

@subhaze
Copy link

subhaze commented Aug 11, 2017

@paulirish It appears these flags wont work when used with the --headless flag :(

https://groups.google.com/a/chromium.org/forum/#!msg/headless-dev/eiudRsYdc3A/vwKjuELBBgAJ

@setthase
Copy link

setthase commented Dec 1, 2017

@paulirish - any news about --headless and issues with self-signed certificates?

@infostreams
Copy link

For the record and for the casual Googler, this is how you can get lighthouse to ignore certificate errors:

lighthouse --chrome-flags="--ignore-certificate-errors" <url>

@vitalyzhakov
Copy link

vitalyzhakov commented May 20, 2019

Hello!

@infostreams , I have check your advice and nothing changed

Error after run says

Insecure document request:
The URL you have provided does not have a valid security certificate.
This site is missing a valid, trusted certificate (net::ERR_CERT_COMMON_NAME_INVALID).

lighthouse --version
5.0.0

Can anybody help to start lighthouse utility working with incorrect SSL?

@infostreams
Copy link

infostreams commented May 21, 2019

Yeah you need to (unfortunately) revert to an older version of lighthouse for now, see #7292 (comment) - but they're working on fixing it more thoroughly.

@Kenith
Copy link

Kenith commented Jul 5, 2019

The ssl issue stills there.

lighthouse --version
5.1.0

@LucianoVandi
Copy link

Same issue on version 5.1.0 with the command:

lighthouse --chrome-flags="--ignore-certificate-errors" <url>

Insecure document request: The URL you have provided does not have a valid security certificate. This site is missing a valid, trusted certificate (net::ERR_CERT_COMMON_NAME_INVALID).

@patrickhulce
Copy link
Collaborator

The fix was merged immediately after 5.1.0 was released. It will go out with 5.2.0.

#8865

@LucianoVandi
Copy link

Thanks @patrickhulce, installing the master branch worked for me.

npm install -g https://github.com/GoogleChrome/lighthouse\#master

@Kenith
Copy link

Kenith commented Jul 22, 2019

Found a force solution.
We could use this solution before the 5.2.0 is ready:

sed -i 's/\"$@\"/--no-sandbox --ignore-certificate-errors \"$@\"/' /opt/google/chrome/google-chrome

@patrickhulce
Copy link
Collaborator

@Kenith all versions of Lighthouse allow you to pass this flag already so that solution should not be necessary. The 5.2.0 change is to allow Lighthouse to continue even though the certificate error is still visible from the DevTools protocol (with the flag present). It's updating the under the hood workings to match the flag's UI effect.

@Kenith
Copy link

Kenith commented Jul 23, 2019

@patrickhulce Thank you for the feedback. And I am much clear now.
Appreciate that you take much so effort & time to contribute the community.
Thank you

@peshoicov
Copy link

For me the issue was the old version of Google Chrome (at this moment I have 74 and the latest stable is 83). Updating it made the audit work.

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