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

Function ssl_hook_pre_config

modules/ssl/mod_ssl.c:391–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391static int ssl_hook_pre_config(apr_pool_t *pconf,
392 apr_pool_t *plog,
393 apr_pool_t *ptemp)
394{
395 modssl_running_statically = modssl_is_prelinked();
396
397#if HAVE_OPENSSL_INIT_SSL || (OPENSSL_VERSION_NUMBER >= 0x10100000L && \
398 !defined(LIBRESSL_VERSION_NUMBER))
399 /* Openssl v1.1+ handles all initialisation automatically, apart
400 * from hints as to how we want to use the library.
401 *
402 * We tell openssl we want to include engine support.
403 */
404 OPENSSL_init_ssl(OPENSSL_INIT_ENGINE_ALL_BUILTIN, NULL);
405
406#else
407 /* Configuration below is for legacy versions Openssl v1.0 and
408 * older.
409 */
410
411#if APR_HAS_THREADS && MODSSL_USE_OPENSSL_PRE_1_1_API
412 ssl_util_thread_id_setup(pconf);
413#endif
414#if MODSSL_USE_OPENSSL_PRE_1_1_API || defined(LIBRESSL_VERSION_NUMBER)
415 (void)CRYPTO_malloc_init();
416#else
417 OPENSSL_malloc_init();
418#endif
419 ERR_load_crypto_strings();
420 SSL_load_error_strings();
421 SSL_library_init();
422#if HAVE_ENGINE_LOAD_BUILTIN_ENGINES
423 ENGINE_load_builtin_engines();
424#endif
425 OpenSSL_add_all_algorithms();
426 OPENSSL_load_builtin_modules();
427#endif
428
429 if (OBJ_txt2nid("id-on-dnsSRV") == NID_undef) {
430 (void)OBJ_create("1.3.6.1.5.5.7.8.7", "id-on-dnsSRV",
431 "SRVName otherName form");
432 }
433
434 /* Start w/o errors (e.g. OBJ_txt2nid() above) */
435 ERR_clear_error();
436
437 /*
438 * Let us cleanup the ssl library when the module is unloaded
439 */
440 apr_pool_cleanup_register(pconf, NULL, ssl_cleanup_pre_config,
441 apr_pool_cleanup_null);
442
443 /* Register us to handle mod_log_config %c/%x variables */
444 ssl_var_log_config_register(pconf);
445
446 /* Register to handle mod_status status page generation */
447 ssl_scache_status_register(pconf);
448

Callers

nothing calls this directly

Calls 5

modssl_is_prelinkedFunction · 0.85
ssl_util_thread_id_setupFunction · 0.85
ap_mutex_registerFunction · 0.85

Tested by

no test coverage detected