我通过https实施节点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')]
};
对每个请求,这是给错误: - ERR_CERT_AUTHORITY_INVALID
我已经搜索了很多,但没有找到。
我使用下面的命令生成客户端密钥: -
OpenSSL的REQ -x509 -newkey RSA:2048 -keyout客户key.pem -out客户cert.pem -days 365
我创建.CRT和服务器私钥,并使用它们。
我做错了吗?