title: How to fix server connection using https client with basic auth and tls pfx certificate?
body: <p>I am trying connect third part server with basic auth and pfx tls certificate using node express platform. I am not sure; Where do I need to set basic auth, cert file  and header params?</p>
  
  <p>For get operation call from remote server, I have  tried to use, https client and tls tool. 
  Request requires ;
  header  = basic auth,schemaVersion, id, applicationName</p>
  
  <p>In addition to sending the basic auth credentials, send the following in the HTTP Header: Content-Type: application/json
  Accept: application/json</p>
  
  <p>and also request require one  additional parameter  i.e. categories</p>
  
  <pre><code>onst https = require('https');
      const options = {
            hostname: 'https://yadda/cards/getAssets',
            headers: {
              Authorization: 'Basic ' + new Buffer(username + ':' + passw).toString('base64'),
              schemaVersion: '2.0.0',
              id: '0000000',
              applicationName: 'yadda',
              Accept: 'application/json',
              'Content-Type': 'application/json',
            },
  
            pfx: fs.readFileSync('/somefile.cert.pfx'),
            passphrase: 'passphrase',
            categories: 'food',
          };
  
         https
            .get(options, (response: any) =&gt; {
              response.on('data', (d: any) =&gt; {
                console.log(`BODY: `, d);
              });
            })
            .on('error', (e: any) =&gt; {
              console.error('Error: ', e);
            });
  
  // With Tls tool, I tried as;
  var fs = require('fs');
      var socket = tls.connect(options, () =&gt; {
        console.log('client connected');
        process.stdin.pipe(socket);
        process.stdin.resume();
      });
  </code></pre>
  
  <p>I would like to get connected with remote server and receive data in response; instead I am getting following error;</p>
  
  <pre><code>ERROR] Error:  { Error: getaddrinfo ENOTFOUND https://yadd/cards/getAssets:443
  at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
    errno: 'ENOTFOUND',
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
  </code></pre>