summaryrefslogtreecommitdiff
path: root/src/conf_mode/https.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/conf_mode/https.py')
-rwxr-xr-xsrc/conf_mode/https.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/conf_mode/https.py b/src/conf_mode/https.py
index 2495cf7e7..289eacf69 100755
--- a/src/conf_mode/https.py
+++ b/src/conf_mode/https.py
@@ -46,11 +46,16 @@ server {
#
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
+
+{% if vyos_cert %}
+ include {{ vyos_cert.conf }};
+{% else %}
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
include snippets/snakeoil.conf;
+{% endif %}
{% for l_addr in listen_address %}
server_name {{ l_addr }};
@@ -88,6 +93,10 @@ def get_config():
addrs = conf.return_values('listen-address')
https['listen_address'] = addrs[:]
+ if conf.exists('certificates'):
+ if conf.exists('certificates system-generated-certificate'):
+ https['vyos_cert'] = vyos.defaults.vyos_cert_data
+
if conf.exists('api'):
https['api'] = vyos.defaults.api_data