Skip to content

Commit

Permalink
Sent a patch today to fix this in core but this hack will fix node th…
Browse files Browse the repository at this point in the history
…at predates that fix to core.
  • Loading branch information
mikeal committed Mar 22, 2011
1 parent 02fc9f7 commit 0b30532
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,23 @@ var toBase64 = function(str) {
return (new Buffer(str || "", "ascii")).toString("base64");
};

// Hacky fix for pre-0.4.4 https
if (https && !https.Agent) {
https.Agent = function (options) {
http.Agent.call(this, options);
}
util.inherits(https.Agent, http.Agent);

https.Agent.prototype._getConnection = function(host, port, cb) {
var s = tls.connect(port, host, this.options, function() {
// do other checks here?
if (cb) cb();
});

return s;
};
}

var isUrl = /^https?:/;

var globalPool = {};
Expand Down

0 comments on commit 0b30532

Please sign in to comment.