From 0d58557cac7add0dd4173c041d92769480fa5c0f Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 2 Dec 2014 23:49:17 +0000 Subject: [PATCH 1/2] Allow SSL connections to bitcoind This is required as, by default, self-signed certificates are rejected as was commented in #436 --- lib/RpcClient.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/RpcClient.js b/lib/RpcClient.js index 8d506bb..909a082 100644 --- a/lib/RpcClient.js +++ b/lib/RpcClient.js @@ -163,6 +163,7 @@ function rpc(request, callback) { path: '/', method: 'POST', port: self.port, + rejectUnauthorized: false, agent: self.disableAgent ? false : undefined, }; if (self.httpOptions) { From 5d2d5ef0242ae61e9e9c1785b094d074044462cb Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 9 Dec 2014 13:44:07 +0000 Subject: [PATCH 2/2] Include rejectUnauthorized in options --- lib/RpcClient.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/RpcClient.js b/lib/RpcClient.js index 909a082..3d1c39f 100644 --- a/lib/RpcClient.js +++ b/lib/RpcClient.js @@ -15,6 +15,7 @@ function RpcClient(opts) { this.protocol = (opts.protocol == 'http') ? http : https; this.batchedCalls = null; this.disableAgent = opts.disableAgent || false; + this.rejectUnauthorized = opts.rejectUnauthorized || false; } RpcClient.prototype.batch = function(batchCallback, resultCallback) { @@ -163,7 +164,7 @@ function rpc(request, callback) { path: '/', method: 'POST', port: self.port, - rejectUnauthorized: false, + rejectUnauthorized: self.rejectUnauthorized, agent: self.disableAgent ? false : undefined, }; if (self.httpOptions) {