From 3a347af543932443d6deeb07cb7a10f569d3c163 Mon Sep 17 00:00:00 2001 From: Ken Date: Thu, 11 Aug 2016 12:20:35 -0400 Subject: [PATCH] #866 Copy CA from options into outbound proxy (#1042) 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 2602305..bf467a2 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;