From 19a715b34848848e22f9c4d7e690661fa51dba6b Mon Sep 17 00:00:00 2001
From: Philipp Zabel
Date: Tue, 11 Jul 2023 13:54:50 +0200
Subject: [PATCH] frontend: Add tls-cert and tls-key config options
Add tls-cert and tls-key config options in the [rdp] and [vnc] sections
in weston.ini. This allows to statically configure the TLS key and
certificate files instead of requiring them to be supplied via command
line arguments.
Signed-off-by: Philipp Zabel
---
compositor/main.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/compositor/main.c b/compositor/main.c
index 6d37773d9..14b12e848 100644
--- a/compositor/main.c
+++ b/compositor/main.c
@@ -3341,6 +3341,11 @@ load_rdp_backend(struct weston_compositor *c,
weston_config_section_get_int(section, "refresh-rate",
&config.refresh_rate,
RDP_DEFAULT_FREQ);
+ weston_config_section_get_string(section, "tls-cert",
+ &config.server_cert,
+ config.server_cert);
+ weston_config_section_get_string(section, "tls-key",
+ &config.server_key, config.server_key);
wet->heads_changed_listener.notify = rdp_heads_changed;
weston_compositor_add_heads_changed_listener(c,
@@ -3443,6 +3448,11 @@ load_vnc_backend(struct weston_compositor *c,
weston_config_section_get_int(section, "refresh-rate",
&config.refresh_rate,
VNC_DEFAULT_FREQ);
+ weston_config_section_get_string(section, "tls-cert",
+ &config.server_cert,
+ config.server_cert);
+ weston_config_section_get_string(section, "tls-key",
+ &config.server_key, config.server_key);
ret = weston_compositor_load_backend(c, WESTON_BACKEND_VNC,
&config.base);