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

Function md_post_config_before_ssl

modules/md/mod_md.c:848–961  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846}
847
848static apr_status_t md_post_config_before_ssl(apr_pool_t *p, apr_pool_t *plog,
849 apr_pool_t *ptemp, server_rec *s)
850{
851 void *data = NULL;
852 const char *mod_md_init_key = "mod_md_init_counter";
853 md_srv_conf_t *sc;
854 md_mod_conf_t *mc;
855 apr_status_t rv = APR_SUCCESS;
856 int dry_run = 0, log_level = APLOG_DEBUG;
857 md_store_t *store;
858
859 apr_pool_userdata_get(&data, mod_md_init_key, s->process->pool);
860 if (data == NULL) {
861 /* At the first start, httpd makes a config check dry run. It
862 * runs all config hooks to check if it can. If so, it does
863 * this all again and starts serving requests.
864 *
865 * On a dry run, we therefore do all the cheap config things we
866 * need to do to find out if the settings are ok. More expensive
867 * things we delay to the real run.
868 */
869 dry_run = 1;
870 log_level = APLOG_TRACE1;
871 ap_log_error( APLOG_MARK, log_level, 0, s, APLOGNO(10070)
872 "initializing post config dry run");
873 apr_pool_userdata_set((const void *)1, mod_md_init_key,
874 apr_pool_cleanup_null, s->process->pool);
875 }
876 else {
877 ap_log_error( APLOG_MARK, APLOG_INFO, 0, s, APLOGNO(10071)
878 "mod_md (v%s), initializing...", MOD_MD_VERSION);
879 }
880
881 (void)plog;
882 init_setups(p, s);
883 md_log_set(log_is_level, log_print, NULL);
884
885 md_config_post_config(s, p);
886 sc = md_config_get(s);
887 mc = sc->mc;
888 mc->dry_run = dry_run;
889
890 md_event_init(p);
891 md_event_subscribe(on_event, mc);
892
893 rv = setup_store(&store, mc, p, s);
894 if (APR_SUCCESS != rv) goto leave;
895
896 rv = md_reg_create(&mc->reg, p, store, mc->proxy_url, mc->ca_certs,
897 mc->min_delay, mc->retry_failover,
898 mc->use_store_locks, mc->lock_wait_timeout);
899 if (APR_SUCCESS != rv) {
900 ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(10072) "setup md registry");
901 goto leave;
902 }
903
904 /* renew on 30% remaining /*/
905 rv = md_ocsp_reg_make(&mc->ocsp, p, store, mc->ocsp_renew_window,

Callers

nothing calls this directly

Calls 15

init_setupsFunction · 0.85
md_log_setFunction · 0.85
md_config_post_configFunction · 0.85
md_config_getFunction · 0.85
md_event_initFunction · 0.85
md_event_subscribeFunction · 0.85
setup_storeFunction · 0.85
md_reg_createFunction · 0.85
md_ocsp_reg_makeFunction · 0.85
init_sslFunction · 0.85
merge_mds_with_confFunction · 0.85

Tested by

no test coverage detected