15

I'm trying to follow this guide https://angular.io/guide/setup-local. I installed node.js and angular cli and build default app:

ng new my-app

Now i want to start app:

cd my-app
ng serve --open

It starts ok:

** Angular Live Development Server is listening on localhost:4200, open your browser on https://localhost:4200/ **
i 「wdm」: Compiled successfully.

But when i open page in Chrome it is privacy error

When i tried to open it in Firefox it all work great. I tried to start app with next command:

 ng serve --open --ssl true

Still the same error. Any help? At this point i don't need https, i just want to be able to open my app in Chrome.

+

I posted wrong error code. I get this: ERR_SSL_PROTOCOL_ERROR

Kngh2
  • 387
  • 2
  • 4
  • 10
  • It looks like you are trying to open your website using SSL protocol (by using `https://` or port `:443`. Could you give us the URL you are using to access to your application ? – Martin Paucot Dec 16 '19 at 08:22
  • why do you try to use --ssl option? is it required for something? just skip it. for local development usually just http is enough – Andrei Dec 16 '19 at 08:29
  • This worked for me! https://stackoverflow.com/a/71604341/2093371 – hestellezg Feb 23 '23 at 22:29

2 Answers2

26

open chrome://flags/#allow-insecure-localhost, enable this flag and restart chrome. Chrome will then ignore wrong certificates for localhost

Andrei
  • 10,117
  • 13
  • 21
  • 5
    It worked! Thank you! Need to use SSL, though: `ng serve --open --ssl true` – Kngh2 Dec 16 '19 at 08:28
  • As mentioned [here](https://stackoverflow.com/a/48767886/998605), you can also go directly to the SSL endpoint in Chrome and click **Proceed** under the Advance button. This procedure solved the issue of NET::ERR_CERT_DATE_INVALID for me. – Abdur Rahman Oct 03 '21 at 13:05
-1

You just open http://localhost:4200 but not https://.

enter image description here

SuperStar518
  • 2,814
  • 2
  • 20
  • 35