summaryrefslogtreecommitdiffstats
path: root/nss_engine_init.c
diff options
context:
space:
mode:
authorrcritten <>2008-07-14 20:25:53 +0000
committerrcritten <>2008-07-14 20:25:53 +0000
commit503b4dfb861a4d3c41936cc9252817b06d865b69 (patch)
treeb34c23d7d0cb299a060f2be3270d4a74ba02925b /nss_engine_init.c
parent9576f57fd1a88959404d3532888bf20c28649f88 (diff)
downloadmod_nss-503b4dfb861a4d3c41936cc9252817b06d865b69.tar.gz
mod_nss-503b4dfb861a4d3c41936cc9252817b06d865b69.tar.xz
mod_nss-503b4dfb861a4d3c41936cc9252817b06d865b69.zip
Don't inherit the MP cache when running in threaded mode
Don't initialize the database if the SSL is disabled in the configuration 454701
Diffstat (limited to 'nss_engine_init.c')
-rw-r--r--nss_engine_init.c39
1 files changed, 35 insertions, 4 deletions
diff --git a/nss_engine_init.c b/nss_engine_init.c
index c4e2d90..ed34ba1 100644
--- a/nss_engine_init.c
+++ b/nss_engine_init.c
@@ -1084,13 +1084,44 @@ void nss_init_Child(apr_pool_t *p, server_rec *base_server)
SSLModConfigRec *mc = myModConfig(base_server);
SSLSrvConfigRec *sc;
server_rec *s;
+ int threaded = 0;
+ int sslenabled = FALSE;
mc->pid = getpid(); /* only call getpid() once per-process */
- if (SSL_InheritMPServerSIDCache(NULL) != SECSuccess) {
- ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
- "SSL_InheritMPServerSIDCache failed");
- nss_log_nss_error(APLOG_MARK, APLOG_ERR, NULL);
+ /*
+ * First, see if ssl is enabled at all
+ */
+ for (s = base_server; s; s = s->next) {
+ sc = mySrvConfig(s);
+ /* If any servers have SSL, we want sslenabled set so we
+ * can perform further initialization
+ */
+
+ if (sc->enabled == UNSET) {
+ sc->enabled = FALSE;
+ }
+
+ if (sc->proxy_enabled == UNSET) {
+ sc->proxy_enabled = FALSE;
+ }
+
+ if ((sc->enabled == TRUE) || (sc->proxy_enabled == TRUE)) {
+ sslenabled = TRUE;
+ }
+ }
+
+ if (sslenabled == FALSE) { /* we are not an SSL/TLS server */
+ return;
+ }
+
+ ap_mpm_query(AP_MPMQ_MAX_THREADS, &threaded);
+ if (!threaded) {
+ if (SSL_InheritMPServerSIDCache(NULL) != SECSuccess) {
+ ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL,
+ "SSL_InheritMPServerSIDCache failed");
+ nss_log_nss_error(APLOG_MARK, APLOG_ERR, NULL);
+ }
}
nss_init_SSLLibrary(base_server);