From 6b25ed2a44dde77f5cbfbf68fb4f5f661a34c1c0 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 14 Nov 2019 13:17:40 -0600 Subject: [service https] T1443: add setting of HTTPS listen port --- interface-definitions/https.xml | 12 ++++++++++++ src/conf_mode/https.py | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/interface-definitions/https.xml b/interface-definitions/https.xml index 403d4ecb0..d9874a1f9 100644 --- a/interface-definitions/https.xml +++ b/interface-definitions/https.xml @@ -31,6 +31,18 @@ + + + Port to listen for HTTPS requests; default 443 + + 1-65535 + Numeric IP port + + + + + + Server names: exact, wildcard, regex, or '_' (any) diff --git a/src/conf_mode/https.py b/src/conf_mode/https.py index d7fcb74de..fbd351e45 100755 --- a/src/conf_mode/https.py +++ b/src/conf_mode/https.py @@ -49,7 +49,7 @@ server { listen 443 ssl; listen [::]:443 ssl; {% else %} - listen {{ server.address }}:443 ssl; + listen {{ server.address }}:{{ server.port }} ssl; {% endif %} {% for name in server.name %} @@ -107,7 +107,11 @@ def get_config(): if conf.exists('listen-address'): for addr in conf.list_nodes('listen-address'): server_block = {'address' : addr} + server_block['port'] = '443' server_block['name'] = ['_'] + if conf.exists('listen-address {0} listen-port'.format(addr)): + port = conf.return_value('listen-address {0} listen-port'.format(addr)) + server_block['port'] = port if conf.exists('listen-address {0} server-name'.format(addr)): names = conf.return_values('listen-address {0} server-name'.format(addr)) server_block['name'] = names[:] -- cgit v1.2.3