Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID

拥有回忆 提交于 2020-01-06 06:30:49

问题


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?


回答1:


I've done the following things which works for me. I upgrade the version of my browser to the latest and it worked me. find this below given link to know how to update browser version. https://www.computerhope.com/issues/ch001388.htm



来源:https://stackoverflow.com/questions/52411188/failed-to-load-resource-neterr-cert-authority-invalid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!