title: How to fix 'Hostname/IP does not match certificate's altnames'
body: <p>I have a problem when I run get a response for service. There are two services. For the first service, it's working perfectly but in the second I have issue "Error [ERR_TLS_CERT_ALTNAME_INVALID]: Hostname/IP does not match certificate's altnames: Cert is empty". When I used Postman with certificates its works perfectly. What should I set or implement to make it works?​</p>
  
  <p>I tried using: checkServerIdentity, rejectUnauthorized: true.</p>
  
  <pre><code>let options = {
      hostname: 'ws.aaa.bbb.nn',
      path: '/api',
      method: 'GET',
      key: fs.readFileSync('/private.crt'),
      cert: fs.readFileSync('/public.crt'),
      passphrase: '***'
  };
  
  const req = https.request(options, (res) =&gt; {
      let body = '';
      res.on('data', (chunk)=&gt; {
          body += chunk;
          console.log(body)
      });
  });
  </code></pre>
  
  <p>Should be status code 200.</p>