Skip to content

Commit

Permalink
tls_wolfssl: fix regression in commit 77f5f5a
Browse files Browse the repository at this point in the history
The wolfSSL_CTX_load_verify_locations_ex() function would still return
an error when no valid CA certificate was found in the directory.
Since before commit 77f5f5a, opensips startup would not fail when
wolfSSL_CTX_load_verify_locations_ex() would return an error, the change
in the above commit would constitute a regression for cases where no valid
certificate is found in the directory.

This commit brings the wolfssl behavior further in line with openssl.

(cherry picked from commit 9999d31)
  • Loading branch information
rvlad-patrascu committed Mar 7, 2023
1 parent 912530b commit 3f61bbe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/tls_wolfssl/wolfssl_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ static int load_ca_dir(WOLFSSL_CTX * ctx, char *directory)
int rc;

if ((rc = wolfSSL_CTX_load_verify_locations_ex(ctx, 0, directory,
WOLFSSL_LOAD_FLAG_IGNORE_ERR|WOLFSSL_LOAD_FLAG_IGNORE_BAD_PATH_ERR)) !=
WOLFSSL_LOAD_FLAG_IGNORE_ERR|WOLFSSL_LOAD_FLAG_IGNORE_BAD_PATH_ERR|
WOLFSSL_LOAD_FLAG_IGNORE_ZEROFILE)) !=
SSL_SUCCESS) {
LM_ERR("unable to load ca directory '%s' (ret=%d)\n", directory, rc);
return -1;
Expand Down

0 comments on commit 3f61bbe

Please sign in to comment.