问题描述
我正在通过https实现node js脚本.
I am implementing node js script over https.
节点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')]
};
在每个请求上都给出错误:-ERR_CERT_AUTHORITY_INVALID
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:-
我在服务器上创建.crt和私钥并使用它们.
I create .crt and private keys on server and using them.
我在这里做错了什么?
推荐答案
我做了以下对我有用的事情.我将浏览器的版本升级到最新版本,并且可以正常工作.在下面的给定链接中找到此链接,以了解如何更新浏览器版本. https://www.computerhope.com/issues/ch001388.htm
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
这篇关于无法加载资源:net :: ERR_CERT_AUTHORITY_INVALID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!