Skip to content

Commit

Permalink
Merge pull request #444 from zowe/1000TurquoisePogs-patch-5
Browse files Browse the repository at this point in the history
Update webapp.js
  • Loading branch information
DivergentEuropeans authored Sep 14, 2022
2 parents 031fab7 + 4f88f1a commit 412c04b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
All notable changes to the Zlux Server Framework package will be documented in this file.
This repo is part of the app-server Zowe Component, and the change logs here may appear on Zowe.org in that section.

## 2.3.0

- Bugfix: Proxies (zss, external services, and those made by router services) now default to the same HTTPS/TLS settings as the app-esrver.

## 2.0.0

- Breaking change: The list of properties sent back from the /server/environment has changed to reflect the different environment values present in Zowe v2
Expand Down
12 changes: 10 additions & 2 deletions lib/webapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -1517,12 +1517,16 @@ WebApp.prototype = {

makeProxy(urlPrefix, noAuth, overrideOptions, host, port) {
const r = express.Router();
let tlsOptions = Object.assign({}, this.options.tlsOptions);
delete tlsOptions.key;
delete tlsOptions.cert;
let options = {
urlPrefix,
isHttps: false,
addProxyAuthorizations: (noAuth? null : this.auth.addProxyAuthorizations),
processProxiedHeaders: (noAuth? null: this.auth.processProxiedHeaders),
allowInvalidTLSProxy: this.options.allowInvalidTLSProxy
allowInvalidTLSProxy: this.options.allowInvalidTLSProxy,
tlsOptions: tlsOptions
};
if (!(host && port)) {
//destined for agent rather than 3rd party server
Expand All @@ -1546,13 +1550,17 @@ WebApp.prototype = {

makeExternalProxy(host, port, urlPrefix, isHttps, noAuth, pluginID, serviceName) {
const r = express.Router();
let tlsOptions = Object.assign({}, this.options.tlsOptions);
delete tlsOptions.key;
delete tlsOptions.cert;
installLog.info(`ZWED0053I`, `${isHttps? 'HTTPS' : 'HTTP'}`, `${pluginID}:${serviceName}`, `${host}:${port}/${urlPrefix}`); //installLog.info(`Setting up ${isHttps? 'HTTPS' : 'HTTP'} proxy ` +`(${pluginID}:${serviceName}) to destination=${host}:${port}/${urlPrefix}`);
let myProxy = proxy.makeSimpleProxy(host, port, {
urlPrefix,
isHttps,
addProxyAuthorizations: (noAuth? null : this.auth.addProxyAuthorizations),
processProxiedHeaders: (noAuth? null : this.auth.processProxiedHeaders),
allowInvalidTLSProxy: this.options.allowInvalidTLSProxy
allowInvalidTLSProxy: this.options.allowInvalidTLSProxy,
tlsOptions: tlsOptions
}, pluginID, serviceName);
proxyMap.set(pluginID + ":" + serviceName, myProxy);
r.use(myProxy);
Expand Down

0 comments on commit 412c04b

Please sign in to comment.