From b4ed12096371bb9224311b95a36a13280829e46b Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 7 Sep 2022 11:26:42 +0100 Subject: portmanager: Expose API to get at SSL/TLS config for a given interface/port --- core/portmanager.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core') diff --git a/core/portmanager.lua b/core/portmanager.lua index c9b90fd7..904c979c 100644 --- a/core/portmanager.lua +++ b/core/portmanager.lua @@ -219,6 +219,13 @@ function get_service_at(interface, port) return data.service, data.server; end +local function get_tls_config_at(interface, port) + local data = active_services:search(nil, interface, port); + if not data or not data[1] or not data[1][1] then return nil, "not-found"; end + data = data[1][1]; + return data.tls_cfg; +end + local function get_service(service_name) return (services[service_name] or {})[1]; end @@ -310,6 +317,7 @@ return { unregister_service = unregister_service; close = close; get_service_at = get_service_at; + get_tls_config_at = get_tls_config_at; get_service = get_service; get_active_services = get_active_services; get_registered_services = get_registered_services; -- cgit v1.2.3