sindresorhus / got

🌐 Human-friendly and powerful HTTP request library for Node.js
MIT License
14.27k stars 935 forks source link

Hostname/IP does not match certificate's altnames #2233

Closed marian-gheorghe closed 1 year ago

marian-gheorghe commented 1 year ago

Describe the bug

  1. I have two domains: source.domain.com (https://source.domain.com) and target.domain.com. Both have valid TLS certificates, issued and signed by public CA (GlobalSign RSA OV SSL CA 2018), with complete (verified) chain.
  2. source.domain.com and target.domain.comare on different IPs.

When I run the below code from the source.domain.com server, an error occurs: Hostname/IP does not match certificate's altnames: Host: target.domain.com. is not in the cert's altnames: DNS:source.domain.com.

Actual behavior

ERROR: Hostname/IP does not match certificate's altnames: Host: target.domain.com. is not in the cert's altnames: DNS:source.domain.com

Expected behavior

No TLS issues ...

Code to reproduce

try {
   await got.get('https://target.domain.com')
} catch(e) {
   logger.error(`ERROR: ` + e);
   return;
}
...

Checklist

marian-gheorghe commented 1 year ago

Not got issue. For those interested this is the problem: https://github.com/nodejs/node/issues/37104