BrowserSync certificate CLI

Viewed 927

I'm using trying to get Browser-sync to work for our development environment. We use SSL/https

I have pasted the recommended snippet into my html file:

  <script id="__bs_script__">//<![CDATA[
    document.write("<script async src='https://HOST:3000/browser-sync/browser-sync-client.js?v=2.26.7'><\/script>".replace("HOST", location.hostname));
  //]]></script>

And I use the following CLI command: npx browser-sync start --https --files "src/**/*"

Unfortunately the browser-sync script is blocked in Chrome (NET::ERR_CERT_AUTHORITY_INVALID) because of an invalid certificate when trying to get it from: https://localhost:3000/browser-sync/browser-sync-client.js?v=2.26.7

My application is hosted on https://localhost:5001, which has a valid certificate.

We don't use Gulp/Grunt, so I would prefer to solve this without having to use those.

I can't use the browser-sync --proxy option, because I need to launch Chrome with the "--remote-debugging-port" option.

1 Answers

I solved it by using chrome://flags/#allow-insecure-localhost

Related