Skip to content

Commit

Permalink
Only run verify certificate sub request if the section exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ndptech committed Dec 11, 2024
1 parent 08cf0c2 commit 1e8cb5e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/lib/tls/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,7 @@ static int tls_virtual_server_cf_parse(TALLOC_CTX *ctx, void *out, void *parent,

if (virtual_server_cf_parse(ctx, out, parent, ci, rule) < 0) return -1;

if (!conf->virtual_server) {
conf->verify_certificate = false;
return 0;
}
if (!conf->virtual_server) return 0;

conf->verify_certificate = cf_section_find(conf->virtual_server, "verify", "certificate") ? true : false;
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tls/verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ int fr_tls_verify_cert_cb(int ok, X509_STORE_CTX *x509_ctx)
* have been added by this point.
*/
if (my_ok && (depth == 0)) {
if (conf->virtual_server && tls_session->verify_client_cert) {
if (conf->verify_certificate && tls_session->verify_client_cert) {
RDEBUG2("Requesting certificate validation");

/*
Expand Down

0 comments on commit 1e8cb5e

Please sign in to comment.