]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: avoid error conditions when importing native CA
authorDaniel Stenberg <daniel@haxx.se>
Wed, 2 Sep 2020 13:26:09 +0000 (15:26 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 2 Sep 2020 20:47:52 +0000 (22:47 +0200)
The code section that is OpenSSL 3+ specific now uses the same logic as
is used in the version < 3 section. It caused a compiler error without
it.

Closes #5907

lib/vtls/openssl.c

index ce6f8445a71dee7f1bcb4ec42fe044d14eb91cd2..5d3da82341ab155c9c6010de4f10ab15c9701574 100644 (file)
@@ -2993,7 +2993,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex)
   {
     if(ssl_cafile) {
       if(!SSL_CTX_load_verify_file(backend->ctx, ssl_cafile)) {
-        if(verifypeer) {
+        if(verifypeer && !imported_native_ca) {
           /* Fail if we insist on successfully verifying the server. */
           failf(data, "error setting certificate file: %s", ssl_cafile);
           return CURLE_SSL_CACERT_BADFILE;
@@ -3005,7 +3005,7 @@ static CURLcode ossl_connect_step1(struct connectdata *conn, int sockindex)
     }
     if(ssl_capath) {
       if(!SSL_CTX_load_verify_dir(backend->ctx, ssl_capath)) {
-        if(verifypeer) {
+        if(verifypeer && !imported_native_ca) {
           /* Fail if we insist on successfully verifying the server. */
           failf(data, "error setting certificate path: %s", ssl_capath);
           return CURLE_SSL_CACERT_BADFILE;