From d60b458f477931115028dea59b9340b632bd62ff Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sat, 30 Jun 2018 23:10:18 +0000 Subject: [PATCH] more efficient checking --- lib/unwrap-tls.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/unwrap-tls.js b/lib/unwrap-tls.js index 58bb588..edab75d 100644 --- a/lib/unwrap-tls.js +++ b/lib/unwrap-tls.js @@ -46,6 +46,12 @@ module.exports.createTcpConnectionHandler = function (state) { function tryTls() { var vhost; + if (!servername) { + if (state.debug) { console.log("No SNI was given, so there's nothing we can do here"); } + deferData('httpsInvalid'); + return; + } + if (!state.servernames.length) { console.info("[Setup] https => admin => setup => (needs bogus tls certs to start?)"); deferData('httpsSetupServer'); @@ -62,12 +68,6 @@ module.exports.createTcpConnectionHandler = function (state) { console.log("TODO: use www bare redirect"); } - if (!servername) { - if (state.debug) { console.log("No SNI was given, so there's nothing we can do here"); } - deferData('httpsInvalid'); - return; - } - function run() { var nextDevice = Devices.next(state.deviceLists, servername); if (!nextDevice) {