Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID

Viewed 34023

I am implementing node js script over https.

Node js

const options = {
  key: fs.readFileSync('private.key'),
  cert: fs.readFileSync('cert.crt'),    
  // This is necessary only if using the client certificate authentication.
  requestCert: true,
  rejectUnauthorized: true,

  // This is necessary only if the client uses the self-signed certificate.
  ca: [fs.readFileSync('client-cert.pem')]
};

On each request this is giving error:- ERR_CERT_AUTHORITY_INVALID

I have searched a lot but nothing found.

I use below command for generating client key:-

openssl req -x509 -newkey rsa:2048 -keyout client-key.pem -out client-cert.pem -days 365

I create .crt and private keys on server and using them.

What I am doing wrong here?

3 Answers

I encountered a similar situation, it is related to certificate. It also gives the information of specific url. Clicking through the url will give your hint to access unsecure content, and clicking through it will allow subsequent access by refreshing url.

enter image description here

Click on the page setting and enable unsafe information the reaload the page.

Related