]> granicus.if.org Git - apache/commitdiff
move server cert/key initialization to ssl_init_server_certs function
authorDoug MacEachern <dougm@apache.org>
Thu, 28 Mar 2002 02:36:05 +0000 (02:36 +0000)
committerDoug MacEachern <dougm@apache.org>
Thu, 28 Mar 2002 02:36:05 +0000 (02:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94258 13f79535-47bb-0310-9956-ffa450edef68

modules/ssl/ssl_engine_init.c

index e55a7cced398047ae2c4cf6ebf8b4524605f9fb8..5ecf0854c4b89327ebf0e458db6378ecfdea8e49 100644 (file)
@@ -808,45 +808,16 @@ static void ssl_check_public_cert(server_rec *s,
     }
 }
 
-/*
- * Configure a particular server
- */
-void ssl_init_ConfigureServer(server_rec *s,
-                              apr_pool_t *p,
-                              apr_pool_t *ptemp,
-                              SSLSrvConfigRec *sc)
+static void ssl_init_server_certs(server_rec *s,
+                                  apr_pool_t *p,
+                                  apr_pool_t *ptemp,
+                                  SSLSrvConfigRec *sc)
 {
     const char *rsa_id, *dsa_id;
     const char *vhost_id = sc->szVHostID;
-    SSL_CTX *ctx;
     int i;
     int have_rsa, have_dsa;
 
-    ssl_init_check_server(s, p, ptemp, sc);
-
-    ctx = ssl_init_ctx(s, p, ptemp, sc);
-
-    ssl_init_session_cache_ctx(s, p, ptemp, sc);
-
-    ssl_init_verify(s, p, ptemp, sc);
-
-    ssl_init_cipher_suite(s, p, ptemp, sc);
-
-    ssl_init_crl(s, p, ptemp, sc);
-
-    ssl_init_cert_chain(s, p, ptemp, sc);
-
-    SSL_CTX_set_tmp_rsa_callback(ctx, ssl_callback_TmpRSA);
-    SSL_CTX_set_tmp_dh_callback(ctx,  ssl_callback_TmpDH);
-
-    if (sc->nLogLevel >= SSL_LOG_INFO) {
-        /* this callback only logs if SSLLogLevel >= info */
-        SSL_CTX_set_info_callback(ctx, ssl_callback_LogTracingState);
-    }
-
-    /*
-     *  Configure server certificate(s)
-     */
     rsa_id = ssl_asn1_table_keyfmt(ptemp, vhost_id, SSL_AIDX_RSA);
     dsa_id = ssl_asn1_table_keyfmt(ptemp, vhost_id, SSL_AIDX_DSA);
 
@@ -876,6 +847,41 @@ void ssl_init_ConfigureServer(server_rec *s,
     }
 }
 
+/*
+ * Configure a particular server
+ */
+void ssl_init_ConfigureServer(server_rec *s,
+                              apr_pool_t *p,
+                              apr_pool_t *ptemp,
+                              SSLSrvConfigRec *sc)
+{
+    SSL_CTX *ctx;
+
+    ssl_init_check_server(s, p, ptemp, sc);
+
+    ctx = ssl_init_ctx(s, p, ptemp, sc);
+
+    ssl_init_session_cache_ctx(s, p, ptemp, sc);
+
+    ssl_init_verify(s, p, ptemp, sc);
+
+    ssl_init_cipher_suite(s, p, ptemp, sc);
+
+    ssl_init_crl(s, p, ptemp, sc);
+
+    ssl_init_cert_chain(s, p, ptemp, sc);
+
+    SSL_CTX_set_tmp_rsa_callback(ctx, ssl_callback_TmpRSA);
+    SSL_CTX_set_tmp_dh_callback(ctx,  ssl_callback_TmpDH);
+
+    if (sc->nLogLevel >= SSL_LOG_INFO) {
+        /* this callback only logs if SSLLogLevel >= info */
+        SSL_CTX_set_info_callback(ctx, ssl_callback_LogTracingState);
+    }
+
+    ssl_init_server_certs(s, p, ptemp, sc);
+}
+
 void ssl_init_CheckServers(server_rec *base_server, apr_pool_t *p)
 {
     server_rec *s, *ps;