I am currently implementing a website using React and Spring as a team project.Since https is required on localhost for social login and project invitation, I issued a self-signed certificate using mkcert and applied it to localhost. I was then able to run https localhost by adding a command to start my package.json with https.
"craco-dev": "set HTTPS=true&&set SSL_CRT_FILE=localhost.pem&&set SSL_KEY_FILE=localhost-key.pem&&cross-env NODE_ENV=development craco start",
It worked without a problem for a few days, but one day when I tried to log in to the React app, the following error message occurred.
${SERVER_API} net::ERR_CERT_AUTHORITY_INVALID
I also confirmed that https appears in the browser search bar and that the message “Your connection is secure” appears when you hover over the lock on the left.So I googled and did the following:
- In edge (currently localhost is running on edge) settings, add the certificate you use for React HTTPS to the list of trusted certificates
- Replace mkcert certificate with openssl certificate
- Delete edge cookies and site data
Even if I did the above, the error remained the same. So, I would like to ask whether it is difficult to run HTTPS on localhost with a self-signed certificate, or if there is a way to solve the problem.Also, not only I but other team members are using the app, so I'm curious if this is the cause.