diff --git a/lib/webserver.js b/lib/webserver.js index 8c9bf0a65..aa988f4a7 100644 --- a/lib/webserver.js +++ b/lib/webserver.js @@ -21,8 +21,8 @@ const stripEmptyRequestBody = (req, res, next) => { next(); }; -function main({ key = null, cert = null, port = 7341 } = {}, altPort = null) { - const http = (!key && !cert); // no https if there's no certs +function main({ httpsKey = null, httpsCert = null, port = 7341 } = {}, altPort = null) { + const http = (!httpsKey && !httpsCert); // no https if there's no certs const https = http ? require('http') : require('https'); const app = express(); @@ -37,8 +37,8 @@ function main({ key = null, cert = null, port = 7341 } = {}, altPort = null) { logger.info('local server listening @ %s', port); const serverArgs = http ? [app] : [{ - key: fs.readFileSync(key), - cert: fs.readFileSync(cert), + key: fs.readFileSync(httpsKey), + cert: fs.readFileSync(httpsCert), }, app]; const server = https.createServer.apply(https, serverArgs).listen(port); diff --git a/test/utils.js b/test/utils.js index ab8dd7401..7dab78ce0 100644 --- a/test/utils.js +++ b/test/utils.js @@ -10,8 +10,8 @@ function port() { const echoServerPort = port(); const { app: echoServer, server } = webserver({ port: echoServerPort, - key: process.env.TEST_KEY, // Optional - cert: process.env.TEST_CERT, // Optional + httpsKey: process.env.TEST_KEY, // Optional + httpsCert: process.env.TEST_CERT, // Optional }); echoServer.get('/echo-param/:param', (req, res) => {