Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output of certificate cannot be used in tls.checkServerIdentity() #19

Open
pszabop opened this issue Jan 24, 2022 · 1 comment
Open

Comments

@pszabop
Copy link

pszabop commented Jan 24, 2022

I have a certificate I would like to verify against the root nodejs store. The certificate is in PEM format.

I attempted to use the built in nodejs function tls.checkServerIdentity() after I used the x509 parser, but I get the following error:

Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Host: messageverificationcerts.sandbox.paypal.com. is not cert's CN: undefined

Source code:

  const x509 = require('@peculiar/x509');
  const cert = new x509.X509Certificate(relevantCert);
  //console.log(util.inspect(cert,false,6)) // appears to output a correct cert
  const tlsResult = tls.checkServerIdentity('messageverificationcerts.sandbox.paypal.com',  cert)
  console.log(tlsResult);
@rmhrisk
Copy link

rmhrisk commented Feb 20, 2022

Please provide the certificate in question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants