Dee*_*yan 9 apache ssl node.js express socket.io
我正在通过 https 实现 Node js 脚本。
节点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')]
};
Run Code Online (Sandbox Code Playgroud)
对于每个请求,都会给出错误:- ERR_CERT_AUTHORITY_INVALID
我已经搜索了很多但没有找到。
我使用以下命令来生成客户端密钥:-
openssl req -x509 -newkey rsa:2048 -keyout client-key.pem -out client-cert.pem -days 365
我在服务器上创建 .crt 和私钥并使用它们。
我在这里做错了什么?
| 归档时间: |
|
| 查看次数: |
42178 次 |
| 最近记录: |