Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x 85013c390 -> 829a12ac6


[TS-4222] Add check to see if SSLConfigParams::load_ssl_file_cb is initialized.

(cherry picked from commit 69381bb0a9f256f64e8365a08dd35349f729fcbf)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/829a12ac
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/829a12ac
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/829a12ac

Branch: refs/heads/6.1.x
Commit: 829a12ac6efddddab7405fdfc047466de83fa0aa
Parents: 85013c3
Author: Sudheer Vinukonda <[email protected]>
Authored: Mon Feb 22 21:47:22 2016 +0000
Committer: Leif Hedstrom <[email protected]>
Committed: Mon Feb 22 15:32:53 2016 -0700

----------------------------------------------------------------------
 iocore/net/SSLUtils.cc | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/829a12ac/iocore/net/SSLUtils.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index 649fda1..ee89721 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);
+      }
     }
   }
 

Reply via email to