Skip to content
Snippets Groups Projects
Verified Commit 7585e879 authored by Petr Špaček's avatar Petr Špaček
Browse files

TLS client: fix certificate loading from file

gnutls_certificate_set_x509_trust_file could theoretically return 0
to indicate nothing was read, so we need to check for this as well.
parent 4a0eb512
Branches
Tags
1 merge request!447TLS polish
......@@ -620,7 +620,7 @@ int tls_client_params_set(map_t *tls_client_paramlist,
} else {
int res = gnutls_certificate_set_x509_trust_file(entry->credentials, value,
GNUTLS_X509_FMT_PEM);
if (res < 0) {
if (res <= 0) {
kr_log_error("[tls_client] failed to import certificate file '%s' (%s)\n",
value, gnutls_strerror_name(res));
/* value will be freed at cleanup */
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment