skip to Main Content

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?

3

Answers


  1. Click on the page setting and enable unsafe information the reaload the page.

    Login or Signup to reply.
  2. –Firstly, Right-click on your computer’s time, then select the option that says "Adjust date/time".
    –"Sync now" under "Synchronize your clock", and click on it.
    so, your system syncing your computer clock.
    look at : https://kinsta.com/knowledgebase/neterr-cert-authority-invalid/

    Login or Signup to reply.
  3. I encountered a similar situation, it is related to certificate. It also gives the information of specific url.
    Clicking through the url will give your hint to access unsecure content, and clicking through it will allow subsequent access by refreshing url.

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search