]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4504: Too many WARNING: Ignoring error setting CA certificate locations
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 15 Jun 2016 14:31:34 +0000 (02:31 +1200)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 15 Jun 2016 14:31:34 +0000 (02:31 +1200)
src/security/PeerOptions.cc

index 3360b9c9b9f6e2e954fb35a5ea87fd9e10cf82c7..a693beafea5371648f4def05af00fec63de189b0 100644 (file)
@@ -587,10 +587,12 @@ void
 Security::PeerOptions::updateContextCa(Security::ContextPtr &ctx)
 {
     debugs(83, 8, "Setting CA certificate locations.");
-
+#if USE_OPENSSL
+    const char *path = caDir.isEmpty() ? nullptr : caDir.c_str();
+#endif
     for (auto i : caFiles) {
 #if USE_OPENSSL
-        if (!SSL_CTX_load_verify_locations(ctx, i.c_str(), caDir.c_str())) {
+        if (!SSL_CTX_load_verify_locations(ctx, i.c_str(), path)) {
             const int ssl_error = ERR_get_error();
             debugs(83, DBG_IMPORTANT, "WARNING: Ignoring error setting CA certificate locations: " << ERR_error_string(ssl_error, NULL));
         }