From: Amos Jeffries Date: Wed, 15 Jun 2016 14:31:34 +0000 (+1200) Subject: Bug 4504: Too many WARNING: Ignoring error setting CA certificate locations X-Git-Tag: SQUID_4_0_12~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=123d5c2aa22a37d9f6f0f84a97c390a37c0c1f04;p=thirdparty%2Fsquid.git Bug 4504: Too many WARNING: Ignoring error setting CA certificate locations --- diff --git a/src/security/PeerOptions.cc b/src/security/PeerOptions.cc index 3360b9c9b9..a693beafea 100644 --- a/src/security/PeerOptions.cc +++ b/src/security/PeerOptions.cc @@ -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)); }