MCPcopy Create free account
hub / github.com/apache/httpd / ssl_init_Module

Function ssl_init_Module

modules/ssl/ssl_engine_init.c:339–589  ·  view source on GitHub ↗

* Per-module initialization */

Source from the content-addressed store, hash-verified

337 * Per-module initialization
338 */
339apr_status_t ssl_init_Module(apr_pool_t *p, apr_pool_t *plog,
340 apr_pool_t *ptemp,
341 server_rec *base_server)
342{
343 unsigned long runtime_lib_version = modssl_runtime_lib_version();
344 SSLModConfigRec *mc = myModConfig(base_server);
345 SSLSrvConfigRec *sc;
346 server_rec *s;
347 apr_status_t rv;
348 apr_array_header_t *pphrases;
349
350 AP_DEBUG_ASSERT(mc);
351
352 if (runtime_lib_version < MODSSL_LIBRARY_VERSION) {
353 ap_log_error(APLOG_MARK, APLOG_WARNING, 0, base_server, APLOGNO(01882)
354 "Init: this version of mod_ssl was compiled against "
355 "a newer library (%s (%s), version currently loaded is 0x%lX)"
356 " - may result in undefined or erroneous behavior",
357 MODSSL_LIBRARY_TEXT, MODSSL_LIBRARY_DYNTEXT,
358 runtime_lib_version);
359 }
360
361 /* We initialize mc->pid per-process in the child init,
362 * but it should be initialized for startup before we
363 * call ssl_rand_seed() below.
364 */
365 mc->pid = getpid();
366
367 /*
368 * Let us cleanup on restarts and exits
369 */
370 apr_pool_cleanup_register(p, base_server,
371 ssl_init_ModuleKill,
372 apr_pool_cleanup_null);
373
374 /*
375 * Any init round fixes the global config
376 */
377 ssl_config_global_create(base_server); /* just to avoid problems */
378 ssl_config_global_fix(mc);
379
380 /*
381 * try to fix the configuration and open the dedicated SSL
382 * logfile as early as possible
383 */
384 for (s = base_server; s; s = s->next) {
385 sc = mySrvConfig(s);
386
387 if (sc->server) {
388 sc->server->sc = sc;
389 }
390
391 /*
392 * Create the server host:port string because we need it a lot
393 */
394 if (sc->vhost_id) {
395 /* already set. This should only happen if this config rec is
396 * shared with another server. Argh! */

Callers

nothing calls this directly

Calls 15

ssl_config_global_createFunction · 0.85
ssl_config_global_fixFunction · 0.85
ssl_util_vhostidFunction · 0.85
ap_get_server_protocolFunction · 0.85
ssl_util_thread_setupFunction · 0.85
ssl_init_EngineFunction · 0.85
ssl_log_ssl_errorFunction · 0.85
ssl_dieFunction · 0.85
ssl_mutex_initFunction · 0.85
ssl_scache_initFunction · 0.85

Tested by

no test coverage detected