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

Function init_cert_watch_status

modules/md/mod_md.c:802–846  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

800}
801
802static int init_cert_watch_status(md_mod_conf_t *mc, apr_pool_t *p, apr_pool_t *ptemp, server_rec *s)
803{
804 md_t *md;
805 md_result_t *result;
806 int i, count;
807
808 /* Calculate the list of MD names which we need to watch:
809 * - all MDs that are used somewhere
810 * - all MDs in drive mode 'AUTO' that are not in 'unused_names'
811 */
812 count = 0;
813 result = md_result_make(ptemp, APR_SUCCESS);
814 for (i = 0; i < mc->mds->nelts; ++i) {
815 md = APR_ARRAY_IDX(mc->mds, i, md_t*);
816 md_result_set(result, APR_SUCCESS, NULL);
817 md->watched = 0;
818 if (md->state == MD_S_ERROR) {
819 md_result_set(result, APR_EGENERAL,
820 "in error state, unable to drive forward. This "
821 "indicates an incomplete or inconsistent configuration. "
822 "Please check the log for warnings in this regard.");
823 continue;
824 }
825
826 if (md->renew_mode == MD_RENEW_AUTO
827 && md_array_str_index(mc->unused_names, md->name, 0, 0) >= 0) {
828 /* This MD is not used in any virtualhost, do not watch */
829 continue;
830 }
831
832 if (md_will_renew_cert(md)) {
833 /* make a test init to detect early errors. */
834 md_reg_test_init(mc->reg, md, mc->env, result, p);
835 if (APR_SUCCESS != result->status && result->detail) {
836 apr_hash_set(mc->init_errors, md->name, APR_HASH_KEY_STRING, apr_pstrdup(p, result->detail));
837 ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(10173)
838 "md[%s]: %s", md->name, result->detail);
839 }
840 }
841
842 md->watched = 1;
843 ++count;
844 }
845 return count;
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)

Callers 1

md_post_config_after_sslFunction · 0.85

Calls 6

md_result_makeFunction · 0.85
md_result_setFunction · 0.85
md_array_str_indexFunction · 0.85
md_will_renew_certFunction · 0.85
md_reg_test_initFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected