SamDecrock / node-http-ntlm

Node.js module to authenticate using HTTP NTLM
MIT License
192 stars 89 forks source link

Node >= v0.11.0 support #21

Closed flakmonkey closed 9 years ago

flakmonkey commented 9 years ago

I'm able to use this library successfully with Node v0.10.33 but, when I upgrade to v0.12, HTTPS support is broken. I will probably take a look at the cause of this problem tomorrow. In the meantime, here's a stack trace that might be useful:

_http_client.js:75
    throw new Error('Protocol "' + protocol + '" not supported. ' +
          ^
Error: Protocol "https:" not supported. Expected "http:".
    at new ClientRequest (_http_client.js:75:11)
    at Object.exports.request (http.js:49:10)
    at Object.exports.request (https.js:136:15)
    at doRequest (/Users/bbailey/Programming/Spark/aws-adfs-saml-node/node_modules/httpntlm/node_modules/httpreq/lib/httpreq.js:327:19)
    at Object.exports.get (/Users/bbailey/Programming/Spark/aws-adfs-saml-node/node_modules/httpntlm/node_modules/httpreq/lib/httpreq.js:43:2)
    at /Users/bbailey/Programming/Spark/aws-adfs-saml-node/node_modules/httpntlm/httpntlm.js:50:12
    at async.iterator.fn (/Users/bbailey/Programming/Spark/aws-adfs-saml-node/node_modules/httpntlm/node_modules/async/lib/async.js:582:34)
    at Immediate._onImmediate (/Users/bbailey/Programming/Spark/aws-adfs-saml-node/node_modules/httpntlm/node_modules/async/lib/async.js:498:34)
    at processImmediate [as _immediateCallback] (timers.js:358:17)
flakmonkey commented 9 years ago

Look like the problem was the agentkeepalive module.

From: https://github.com/node-modules/agentkeepalive

node >= 0.11.0: use agentkeepalive@1.2.0+
node < 0.11.0: use agentkeepalive@0.2.2

I tested my use case after upgrading agentkeepalive and the error seems to be fixed.

SamDecrock commented 9 years ago

Super, Thanks!

I've update the package.json file