diff --git a/command/cmd_rtty.uc b/command/cmd_rtty.uc index fd0ff04..8b511c3 100644 --- a/command/cmd_rtty.uc +++ b/command/cmd_rtty.uc @@ -26,7 +26,6 @@ cursor.set("rtty", "@rtty[-1]", "host", args.server); cursor.set("rtty", "@rtty[-1]", "port", args.port); cursor.set("rtty", "@rtty[-1]", "token", args.token); cursor.set("rtty", "@rtty[-1]", "timeout", args.timeout); -cursor.set("rtty", "@rtty[-1]", "ssl", 1); cursor.commit(); system("/etc/init.d/rtty restart"); diff --git a/renderer/templates/services/rtty.uc b/renderer/templates/services/rtty.uc index 9f55d5a..68950a3 100644 --- a/renderer/templates/services/rtty.uc +++ b/renderer/templates/services/rtty.uc @@ -9,3 +9,4 @@ set rtty.@rtty[-1].enable={{ b((rtty.token && rtty.host && rtty.port)) }} set rtty.@rtty[-1].token={{ s(rtty.token) }} set rtty.@rtty[-1].host={{ s(rtty.host) }} set rtty.@rtty[-1].port={{ s(rtty.port) }} +set rtty.@rtty[-1].ssl={{ b(rtty.mutual_tls) }} diff --git a/schema/service.rtty.yml b/schema/service.rtty.yml index 3fb67ed..e1e456f 100644 --- a/schema/service.rtty.yml +++ b/schema/service.rtty.yml @@ -23,3 +23,8 @@ properties: minLength: 32 examples: - 01234567890123456789012345678901 + mutual-tls: + description: + Shall the connection enforce mTLS + type: boolean + default: true diff --git a/schemareader.uc b/schemareader.uc index 1715c6a..81b4a0a 100644 --- a/schemareader.uc +++ b/schemareader.uc @@ -6424,6 +6424,20 @@ function instantiateServiceRtty(location, value, errors) { obj.token = parseToken(location + "/token", value["token"], errors); } + function parseMutualTls(location, value, errors) { + if (type(value) != "bool") + push(errors, [ location, "must be of type boolean" ]); + + return value; + } + + if (exists(value, "mutual-tls")) { + obj.mutual_tls = parseMutualTls(location + "/mutual-tls", value["mutual-tls"], errors); + } + else { + obj.mutual_tls = true; + } + return obj; } diff --git a/ucentral.schema.json b/ucentral.schema.json index 323ca79..079a832 100644 --- a/ucentral.schema.json +++ b/ucentral.schema.json @@ -2342,6 +2342,10 @@ "examples": [ "01234567890123456789012345678901" ] + }, + "mutual-tls": { + "type": "boolean", + "default": true } } },