Repository: trafficserver Updated Branches: refs/heads/ts4222 [created] 69381bb0a
[TS-4222] Add check to see if SSLConfigParams::load_ssl_file_cb is initialized. Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/69381bb0 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/69381bb0 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/69381bb0 Branch: refs/heads/ts4222 Commit: 69381bb0a9f256f64e8365a08dd35349f729fcbf Parents: e90a723 Author: Sudheer Vinukonda <[email protected]> Authored: Mon Feb 22 21:47:22 2016 +0000 Committer: Sudheer Vinukonda <[email protected]> Committed: Mon Feb 22 21:47:22 2016 +0000 ---------------------------------------------------------------------- iocore/net/SSLUtils.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/69381bb0/iocore/net/SSLUtils.cc ---------------------------------------------------------------------- diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc index db87148..ff3fb46 100644 --- a/iocore/net/SSLUtils.cc +++ b/iocore/net/SSLUtils.cc @@ -1198,7 +1198,9 @@ SSLPrivateKeyHandler(SSL_CTX *ctx, const SSLConfigParams *params, const ats_scop SSLError("failed to load server private key from %s", (const char *)completeServerKeyPath); return false; } - SSLConfigParams::load_ssl_file_cb(completeServerKeyPath, CONFIG_FLAG_UNVERSIONED); + if (SSLConfigParams::load_ssl_file_cb) { + SSLConfigParams::load_ssl_file_cb(completeServerKeyPath, CONFIG_FLAG_UNVERSIONED); + } } else { SSLError("empty SSL private key path in records.config"); return false; @@ -1381,7 +1383,9 @@ SSLInitServerContext(const SSLConfigParams *params, const ssl_user_config &sslMu goto fail; } certList.push_back(cert); - SSLConfigParams::load_ssl_file_cb(completeServerCertPath, CONFIG_FLAG_UNVERSIONED); + if (SSLConfigParams::load_ssl_file_cb) { + SSLConfigParams::load_ssl_file_cb(completeServerCertPath, CONFIG_FLAG_UNVERSIONED); + } // Load up any additional chain certificates X509 *ca; while ((ca = PEM_read_bio_X509(bio.get(), NULL, 0, NULL))) { @@ -1404,7 +1408,9 @@ SSLInitServerContext(const SSLConfigParams *params, const ssl_user_config &sslMu SSLError("failed to load global certificate chain from %s", (const char *)completeServerCertChainPath); goto fail; } - SSLConfigParams::load_ssl_file_cb(completeServerCertChainPath, CONFIG_FLAG_UNVERSIONED); + if (SSLConfigParams::load_ssl_file_cb) { + SSLConfigParams::load_ssl_file_cb(completeServerCertChainPath, CONFIG_FLAG_UNVERSIONED); + } } // Now, load any additional certificate chains specified in this entry. @@ -1414,7 +1420,9 @@ SSLInitServerContext(const SSLConfigParams *params, const ssl_user_config &sslMu SSLError("failed to load certificate chain from %s", (const char *)completeServerCertChainPath); goto fail; } - SSLConfigParams::load_ssl_file_cb(completeServerCertChainPath, CONFIG_FLAG_UNVERSIONED); + if (SSLConfigParams::load_ssl_file_cb) { + SSLConfigParams::load_ssl_file_cb(completeServerCertChainPath, CONFIG_FLAG_UNVERSIONED); + } } }
