mirror of
https://github.com/jorisvink/kore
synced 2025-03-09 12:39:01 -04:00
Support crls for kore.domain() in Python.
The crl keyword is parsed when the client_verify keyword has been set. eg: kore.domain("kore.io", cert="cert.pem", key="key.pem", client_verify="cacert.pem", verify_depth=1, crl="crl.pem")
This commit is contained in:
parent
56875abc6b
commit
52ff37c5be
@ -2221,11 +2221,12 @@ python_kore_domain(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
long depth;
|
||||
const char *name;
|
||||
struct pydomain *domain;
|
||||
const char *cert, *key, *ca, *attach;
|
||||
const char *cert, *key, *ca, *attach, *crl;
|
||||
|
||||
ca = NULL;
|
||||
depth = -1;
|
||||
key = NULL;
|
||||
crl = NULL;
|
||||
cert = NULL;
|
||||
attach = NULL;
|
||||
|
||||
@ -2282,6 +2283,7 @@ python_kore_domain(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
"invalid depth '%d'", depth);
|
||||
return (NULL);
|
||||
}
|
||||
crl = python_string_from_dict(kwargs, "crl");
|
||||
}
|
||||
} else if (key != NULL || cert != NULL || ca != NULL) {
|
||||
kore_log(LOG_INFO, "ignoring tls settings for '%s'", name);
|
||||
@ -2319,6 +2321,8 @@ python_kore_domain(PyObject *self, PyObject *args, PyObject *kwargs)
|
||||
if (ca != NULL) {
|
||||
domain->config->cafile = kore_strdup(ca);
|
||||
domain->config->x509_verify_depth = depth;
|
||||
if (crl != NULL)
|
||||
domain->config->crlfile = kore_strdup(crl);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user