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?