#include "daemon/network.h"
#include "daemon/tls.h"
#include "lib/utils.h"
+#include "lua.h"
#include <stdlib.h>
return 1;
}
+#include "lib/resolve.h"
+static int net_tls_whitelist(lua_State *L)
+{
+ if (!the_network || !the_network->tls_credentials)
+ return 1;
+
+ int r = kr_init_whitelist(lua_tostring(L, 1));
+ lua_error_maybe(L, r);
+
+ lua_pushboolean(L, true);
+ return 1;
+}
+
static int net_tls(lua_State *L)
{
if (kr_fails_assert(the_network)) {
{ "tls_padding", net_tls_padding },
{ "tls_sticket_secret", net_tls_sticket_secret_string },
{ "tls_sticket_secret_file", net_tls_sticket_secret_file },
+ { "tls_whitelist", net_tls_whitelist },
{ "outgoing_v4", net_outgoing_v4 },
{ "outgoing_v6", net_outgoing_v6 },
{ "tcp_in_idle", net_tcp_in_idle },
],
"description": "EDNS(0) padding of queries and answers sent over an encrypted channel.",
"default": true
+ },
+ "whitelist": {
+ "type": [
+ "string",
+ "null"
+ ],
+ "description": "Path to certificate authority whitelist file",
+ "default": null
}
},
"default": {
"sticket_secret": null,
"sticket_secret_file": null,
"auto_discovery": false,
- "padding": true
+ "padding": true,
+ "whitelist": null
}
},
"proxy-protocol": {
"sticket_secret": null,
"sticket_secret_file": null,
"auto_discovery": false,
- "padding": true
+ "padding": true,
+ "whitelist": null
},
"proxy_protocol": false,
"listen": [
sticket_secret_file: Path to file with secret for TLS session resumption via tickets. (RFC 5077).
auto_discovery: Experimental automatic discovery of authoritative servers supporting DNS-over-TLS.
padding: EDNS(0) padding of queries and answers sent over an encrypted channel.
+ whitelist: Path to certificate authority whitelist file
"""
files_watchdog: Union[Literal["auto"], bool] = "auto"
sticket_secret_file: Optional[ReadableFile] = None
auto_discovery: bool = False
padding: Union[bool, Int0_512] = True
+ whitelist: Optional[ReadableFile] = None
_LAYER = Raw
sticket_secret_file: Optional[ReadableFile] = None
auto_discovery: bool = False
padding: Union[bool, Int0_512] = True
+ whitelist: Optional[ReadableFile] = None
def _files_watchdog(self, obj: Raw) -> Any:
if obj.files_watchdog == "auto":
net.tls('{{ cfg.network.tls.cert_file }}', '{{ cfg.network.tls.key_file }}')
{% endif %}
+{% if cfg.network.tls.whitelist %}
+-- network.tls_whitelist
+net.tls_whitelist('{{ cfg.network.tls.whitelist }}')
+{% endif %}
+
{% if cfg.network.tls.sticket_secret %}
-- network.tls.sticket-secret
net.tls_sticket_secret('{{ cfg.network.tls.sticket_secret }}')