Throw exception is TLS backend isnt supported.

This commit is contained in:
Joris Vink 2022-02-18 09:17:58 +01:00
parent feb90208ef
commit b20d26e839
1 changed files with 7 additions and 0 deletions

View File

@ -1895,6 +1895,13 @@ python_kore_server(PyObject *self, PyObject *args, PyObject *kwargs)
srv = kore_server_create(name);
python_bool_from_dict(kwargs, "tls", &srv->tls);
if (srv->tls && !kore_tls_supported()) {
kore_server_free(srv);
PyErr_SetString(PyExc_RuntimeError,
"TLS not supported in this Kore build");
return (NULL);
}
if (ip != NULL) {
if ((port = python_string_from_dict(kwargs, "port")) == NULL) {
kore_server_free(srv);