From 979fa6de794f46bdc3cb9ab0c910fc21d8dce58b Mon Sep 17 00:00:00 2001 From: Ajith Antony Date: Mon, 24 Jan 2011 06:52:29 -0600 Subject: [PATCH] Small change to do Https. Not sure when the secure flag was added, but this wasn't working in node 0.2.5 or 0.2.6. Without the secure flag, node will attempts to open the socket and perform the http get without first performing an SSL handshake. --- lib/node.io/request.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/node.io/request.js b/lib/node.io/request.js index 9a4069a..93acc4d 100755 --- a/lib/node.io/request.js +++ b/lib/node.io/request.js @@ -174,7 +174,9 @@ Job.prototype.doRequest = function (method, resource, body, headers, callback, p port = (url.protocol === 'http:') ? 80 : 443; } - var host = http.createClient(port, url.hostname), + var secure = (url.protocol == 'https:') ? true : false; + + var host = http.createClient(port, url.hostname, secure), req_url = url.pathname; if (typeof headers.host === 'undefined') { @@ -502,4 +504,4 @@ var HttpProxy = function (host) { * Export proxies */ exports.HttpProxy = HttpProxy; -exports.Proxy = Proxy; \ No newline at end of file +exports.Proxy = Proxy;