| 760 | } |
| 761 | |
| 762 | static apr_status_t check_usage(md_mod_conf_t *mc, md_t *md, server_rec *base_server, |
| 763 | apr_pool_t *p, apr_pool_t *ptemp) |
| 764 | { |
| 765 | server_rec *s; |
| 766 | md_srv_conf_t *sc; |
| 767 | apr_status_t rv = APR_SUCCESS; |
| 768 | int i, has_ssl; |
| 769 | apr_array_header_t *servers; |
| 770 | |
| 771 | (void)p; |
| 772 | servers = apr_array_make(ptemp, 5, sizeof(server_rec*)); |
| 773 | has_ssl = 0; |
| 774 | for (s = base_server; s; s = s->next) { |
| 775 | sc = md_config_get(s); |
| 776 | if (!sc || !sc->assigned) continue; |
| 777 | for (i = 0; i < sc->assigned->nelts; ++i) { |
| 778 | if (md == APR_ARRAY_IDX(sc->assigned, i, md_t*)) { |
| 779 | APR_ARRAY_PUSH(servers, server_rec*) = s; |
| 780 | if (sc->is_ssl) has_ssl = 1; |
| 781 | } |
| 782 | } |
| 783 | } |
| 784 | |
| 785 | if (!has_ssl && md->require_https > MD_REQUIRE_OFF) { |
| 786 | /* We require https for this MD, but do we have a SSL vhost? */ |
| 787 | ap_log_error(APLOG_MARK, APLOG_WARNING, 0, base_server, APLOGNO(10105) |
| 788 | "MD %s does not match any VirtualHost with 'SSLEngine on', " |
| 789 | "but is configured to require https. This cannot work.", md->name); |
| 790 | } |
| 791 | if (apr_is_empty_array(servers)) { |
| 792 | if (md->renew_mode != MD_RENEW_ALWAYS) { |
| 793 | /* Not an error, but looks suspicious */ |
| 794 | ap_log_error(APLOG_MARK, APLOG_WARNING, 0, base_server, APLOGNO(10045) |
| 795 | "No VirtualHost matches Managed Domain %s", md->name); |
| 796 | APR_ARRAY_PUSH(mc->unused_names, const char*) = md->name; |
| 797 | } |
| 798 | } |
| 799 | return rv; |
| 800 | } |
| 801 | |
| 802 | static int init_cert_watch_status(md_mod_conf_t *mc, apr_pool_t *p, apr_pool_t *ptemp, server_rec *s) |
| 803 | { |
no test coverage detected