title: NodeJs can't authenticate over NTLM
body: <p>We are using httpntlm (<a href="https://www.npmjs.com/package/httpntlm" rel="nofollow noreferrer">https://www.npmjs.com/package/httpntlm</a>) library in order to authenticate with NTLM.</p>
  <p>We are following the 3 steps of the protocol as example:</p>
  <pre><code>var ntlm = require('httpntlm').ntlm;
  var async = require('async');
  var httpreq = require('httpreq');
  var HttpsAgent = require('agentkeepalive').HttpsAgent;
  var keepaliveAgent = new HttpsAgent();
  
  var options = {
      url: &quot;https://someurl.com&quot;,
      username: 'm$',
      password: 'stinks',
      workstation: 'choose.something',
      domain: ''
  };
  
  async.waterfall([
  function (callback){
      var type1msg = ntlm.createType1Message(options);
  
      httpreq.get(options.url, {
          headers:{
              'Connection' : 'keep-alive',
              'Authorization': type1msg
          },
          agent: keepaliveAgent
      }, callback);
  },
  
  function (res, callback){
      if(!res.headers['www-authenticate'])
          return callback(new Error('www-authenticate not found on response of second request'));
  
      var type2msg = ntlm.parseType2Message(res.headers['www-authenticate']);
      var type3msg = ntlm.createType3Message(type2msg, options);
  
      setImmediate(function() {
          httpreq.get(options.url, {
              headers:{
                  'Connection' : 'Close',
                  'Authorization': type3msg
              },
              allowRedirects: false,
              agent: keepaliveAgent
          }, callback);
      });
  }
  ], function (err, res) {
      if(err) return console.log(err);
  
      console.log(res.headers);
      console.log(res.body);
  });
  </code></pre>
  <p>We get 401 in the first 2 calls, then the last one responses with 400 BadRequest.
  If I use Postman with NTLM authentication and I inspect the requests, the last call works and I get 200.
  (I've tried also axios-ntlm (<a href="https://www.npmjs.com/package/axios-ntlm" rel="nofollow noreferrer">https://www.npmjs.com/package/axios-ntlm</a>) and I get the same error.</p>
  <p>have you guys had this problem befor by any chance?</p>