From f5a04c269dbcc1e75ce6d47afac76910c9903cb2 Mon Sep 17 00:00:00 2001 From: Ken Preudhomme Date: Thu, 28 Jul 2016 08:31:54 -0400 Subject: [PATCH] #866 Copy CA from options into outbound proxy While using secure: true for proxy connections, there is no way to pass the trusted root CA(s) or intermediate CA(s). This change allows that to be passed in the httpProxy createServer options and used for the outgoing proxy connection. --- lib/http-proxy/common.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js index 2602305d7..bf467a2cd 100644 --- a/lib/http-proxy/common.js +++ b/lib/http-proxy/common.js @@ -49,6 +49,10 @@ common.setupOutgoing = function(outgoing, options, req, forward) { if (options.auth) { outgoing.auth = options.auth; } + + if (options.ca) { + outgoing.ca = options.ca; + } if (isSSL.test(options[forward || 'target'].protocol)) { outgoing.rejectUnauthorized = (typeof options.secure === "undefined") ? true : options.secure;