125 if (!
ad->acme->acct) {
134 "Configure one using the MDContactEmail or ServerAdmin directive.", md->
name);
144 "the CA requires you to accept the terms-of-service "
145 "as specified in <%s>. "
146 "Please read the document that you find at that URL and, "
147 "if you agree to the conditions, configure "
148 "\"MDCertificateAgreement accepted\" "
149 "in your Apache. Then (graceful) restart the server to activate.",
150 ad->acme->ca_agreement);
158 "the CA requires 'External Account Binding' which is not "
159 "configured. This means you need to obtain a 'Key ID' and a "
160 "'HMAC' from the CA and configure that using the "
161 "MDExternalAccountBinding directive in your config. "
162 "The creation of a new ACME account will most likely fail, "
163 "but an attempt is made anyway.",
164 ad->acme->ca_agreement);
202 if (
ad->chain_up_link) {
204 "server reports up link as %s",
ad->chain_up_link);
217 "parse certs from %s -> %d (%s)",
res->req->url,
res->status,
ct);
218 if (
ct && !
strcmp(
"application/x-pkcs7-mime",
ct)) {
228 "cert not in response from %s",
res->req->url);
242 count =
ad->cred->chain->nelts;
245 ad->cred->chain->nelts -
count);
258 ad->order->certificate);
302 const char *location;
310 "cert created without giving its location header");
315 d->md->name,
ad->order, 0))) {
317 "%s: saving cert url %s",
d->md->name, location);
333 "cert not in response, need to poll %s", location);
364 spec =
ad->cred->spec;
405 if (
ct && !
strcmp(
"application/x-pkcs7-mime",
ct)) {
431 "next chain cert at %s",
ad->chain_up_link);
439 "error retrieving certificate from %s",
ad->chain_up_link);
443 else if (
ad->cred->chain->nelts <= 1) {
447 "no link header 'up' for new certificate, unable to retrieve chain");
457 "got chain with %d certs (%d. attempt)",
ad->cred->chain->nelts, attempt);
480 "%s: asked to retrieve chain, but no order in context",
d->md->name);
483 if (!
ad->order->certificate) {
486 "%s: asked to retrieve chain, but no certificate url part of order",
d->md->name);
532 "%s: init_base driver",
d->md->name);
540 const char *challenge;
555 else if (
d->md->ca_challenges &&
d->md->ca_challenges->nelts > 0) {
565 if (!
d->can_http && !
d->can_https
568 "the server seems neither reachable via http (port 80) nor https (port 443). "
569 "Please look at the MDPortMap configuration directive on how to correct this. "
570 "The ACME protocol needs at least one of those so the CA can talk to the server "
571 "and verify a domain ownership. Alternatively, you may configure support "
591 &&
NULL ==
d->md->dns01_cmd
599 "None of the ACME challenge methods configured for this domain are suitable.%s%s%s%s",
600 dis_http?
" The http: challenge 'http-01' is disabled because the server seems not reachable on public port 80." :
"",
601 dis_https?
" The https: challenge 'tls-alpn-01' is disabled because the server seems not reachable on public port 443." :
"",
602 dis_alpn_acme?
" The https: challenge 'tls-alpn-01' is disabled because the Protocols configuration does not include the 'acme-tls/1' protocol." :
"",
603 dis_dns?
" The DNS challenge 'dns-01' is disabled because the directive 'MDChallengeDns01' is not configured." :
""
629 for (
i = 0;
i <
ad->creds->nelts; ++
i) {
659 const char *ca_effective =
NULL;
663 if (!
d->md->ca_urls ||
d->md->ca_urls->nelts <= 0) {
666 "The managed domain %s is missing MDCertificateAuthority",
d->md->name);
688 if (
ad->md &&
ad->md->ca_effective) {
690 ca_effective =
ad->md->ca_effective;
691 if (
d->md->ca_urls->nelts > 1 &&
d->attempt >=
d->retry_failover) {
715 "state=%d, attempt=%d, acme=%s, challenges='%s'",
716 d->md->name,
d->md->state,
d->attempt, ca_effective,
725 "%s: reset staging area",
d->md->name);
739 "The managed domain %s is missing required information",
d->md->name);
755 ad->md->ca_effective = ca_effective;
756 ad->md->ca_account =
NULL;
770 d->md->name, ca_effective);
772 d->proxy_url,
d->ca_file))) {
783 for (
i = 0;
i <
ad->creds->nelts; ++
i) {
793 "ACME server speaks version 1, an obsolete version of the ACME "
794 "protocol that is no longer supported.");
812 "%s: retrieving %s certificate chain",
823 if (!
ad->cred->pkey) {
831 if (
ad->cred->pkey) {
844 ad->cred->spec,
ad->cred->chain, 0);
871 "%s: certificates ready, activation delay set to %s",
876 for (
i = 0;
i <
ad->creds->nelts; ++
i) {
891 "%s: state is COMPLETE, checking existing certificates",
d->md->name);
893 if (
d->activation_delay < 0) {
897 "%s: delay ready_at to now+1s",
d->md->name);
914 "The certificate for the managed domain has been renewed successfully and can "
915 "be used from %s on.", ts);
919 "The certificate for the managed domain has been renewed successfully and can "
920 "be used (valid since %s). A graceful server restart now is recommended.", ts);
1034 d->proxy_url,
d->ca_file))) {
APR-UTIL Buckets/Bucket Brigades.
APR general purpose library routines.
apr_size_t const unsigned char unsigned int unsigned int d
ap_vhost_iterate_conn_cb void * baton
#define APR_STATUS_IS_EINVAL(s)
#define APR_STATUS_IS_ENOENT(s)
apr_pool_t apr_dbd_t apr_dbd_results_t ** res
apr_array_header_t ** result
const char apr_uint32_t * id
#define apr_pcalloc(p, size)
#define APR_ARRAY_PUSH(ary, type)
#define APR_ARRAY_IDX(ary, i, type)
const apr_array_header_t * first
#define APR_RFC822_DATE_LEN
#define apr_time_from_sec(sec)
@ MD_S_MISSING_INFORMATION
md_t * md_copy(apr_pool_t *p, const md_t *src)
void md_acme_clear_acct(md_acme_t *acme)
apr_status_t md_acme_use_acct_for_md(md_acme_t *acme, struct md_store_t *store, apr_pool_t *p, const char *acct_id, const md_t *md)
const char * md_acme_acct_id_get(md_acme_t *acme)
apr_status_t md_acme_req_body_init(md_acme_req_t *req, md_json_t *payload)
apr_status_t md_acme_setup(md_acme_t *acme, md_result_t *result)
apr_status_t md_acme_GET(md_acme_t *acme, const char *url, md_acme_req_init_cb *on_init, md_acme_req_json_cb *on_json, md_acme_req_res_cb *on_res, md_acme_req_err_cb *on_err, void *baton)
apr_status_t md_acme_POST(md_acme_t *acme, const char *url, md_acme_req_init_cb *on_init, md_acme_req_json_cb *on_json, md_acme_req_res_cb *on_res, md_acme_req_err_cb *on_err, void *baton)
apr_status_t md_acme_create(md_acme_t **pacme, apr_pool_t *p, const char *url, const char *proxy_url, const char *ca_file)
void md_acme_report_result(md_acme_t *acme, apr_status_t rv, struct md_result_t *result)
#define MD_ACME_VERSION_MAJOR(i)
apr_status_t md_acme_acct_save(md_store_t *store, apr_pool_t *p, md_acme_t *acme, const char **pid, md_acme_acct_t *acct, md_pkey_t *acct_key)
apr_status_t md_acme_acct_load(md_acme_acct_t **pacct, md_pkey_t **ppkey, md_store_t *store, md_store_group_t group, const char *name, apr_pool_t *p)
apr_status_t md_acme_acct_validate(md_acme_t *acme, md_store_t *store, apr_pool_t *p)
apr_status_t md_acme_acct_id_for_md(const char **pid, md_store_t *store, md_store_group_t group, const md_t *md, apr_pool_t *p)
md_json_t * md_acme_acct_to_json(md_acme_acct_t *acct, apr_pool_t *p)
apr_status_t md_acme_find_acct_for_md(md_acme_t *acme, md_store_t *store, const md_t *md)
apr_status_t md_acme_acct_register(md_acme_t *acme, md_store_t *store, const md_t *md, apr_pool_t *p)
#define MD_AUTHZ_TYPE_DNS01
#define MD_AUTHZ_TYPE_HTTP01
#define MD_AUTHZ_TYPE_TLSALPN01
static apr_status_t acme_driver_preload_init(md_proto_driver_t *d, md_result_t *result)
static apr_status_t on_add_chain(md_acme_t *acme, const md_http_response_t *res, void *baton)
static apr_status_t use_staged_acct(md_acme_t *acme, struct md_store_t *store, const md_t *md, apr_pool_t *p)
static apr_status_t acme_complete_md(md_t *md, apr_pool_t *p)
static apr_status_t acme_driver_renew(md_proto_driver_t *d, md_result_t *result)
static apr_status_t acme_driver_init(md_proto_driver_t *d, md_result_t *result)
apr_status_t md_acme_protos_add(apr_hash_t *protos, apr_pool_t *p)
static apr_status_t get_chain(void *baton, int attempt)
static apr_status_t csr_req(md_acme_t *acme, const md_http_response_t *res, void *baton)
static apr_status_t add_http_certs(apr_array_header_t *chain, apr_pool_t *p, const md_http_response_t *res)
static apr_status_t save_acct_staged(md_acme_t *acme, md_store_t *store, const char *md_name, apr_pool_t *p)
static apr_status_t on_init_csr_req(md_acme_req_t *req, void *baton)
static md_proto_t ACME_PROTO
static apr_status_t get_cert(void *baton, int attempt)
apr_status_t md_acme_drive_setup_cred_chain(md_proto_driver_t *d, md_result_t *result)
static void get_up_link(md_proto_driver_t *d, apr_table_t *headers)
static apr_status_t acme_driver_preload(md_proto_driver_t *d, md_store_group_t group, md_result_t *result)
static apr_status_t acme_preload(md_proto_driver_t *d, md_store_group_t load_group, const char *name, md_result_t *result)
apr_status_t md_acme_drive_cert_poll(md_proto_driver_t *d, int only_once)
static apr_status_t load_missing_creds(md_proto_driver_t *d)
apr_status_t md_acme_drive_set_acct(md_proto_driver_t *d, md_result_t *result)
static apr_status_t ad_chain_retrieve(md_proto_driver_t *d)
static apr_status_t on_add_cert(md_acme_t *acme, const md_http_response_t *res, void *baton)
static apr_status_t acme_renew(md_proto_driver_t *d, md_result_t *result)
apr_status_t md_acme_order_save(struct md_store_t *store, apr_pool_t *p, md_store_group_t group, const char *md_name, md_acme_order_t *authz_set, int create)
apr_status_t md_acme_order_purge(md_store_t *store, apr_pool_t *p, md_store_group_t group, const md_t *md, apr_table_t *env)
apr_status_t md_acmev2_drive_renew(md_acme_driver_t *ad, md_proto_driver_t *d, md_result_t *result)
apr_status_t md_cert_chain_read_http(struct apr_array_header_t *chain, apr_pool_t *p, const struct md_http_response_t *res)
md_pkey_spec_t * md_pkeys_spec_get(const md_pkeys_spec_t *pks, int index)
const char * md_pkey_spec_name(const md_pkey_spec_t *spec)
apr_time_t md_cert_get_not_before(const md_cert_t *cert)
apr_status_t md_cert_req_create(const char **pcsr_der_64, const char *name, apr_array_header_t *domains, int must_staple, md_pkey_t *pkey, apr_pool_t *p)
int md_pkeys_spec_count(const md_pkeys_spec_t *pks)
apr_status_t md_pkey_gen(md_pkey_t **ppkey, apr_pool_t *p, md_pkey_spec_t *spec)
apr_status_t md_check_cert_and_pkey(struct apr_array_header_t *certs, md_pkey_t *pkey)
apr_status_t md_cert_read_http(md_cert_t **pcert, apr_pool_t *p, const md_http_response_t *res)
md_json_t * md_json_create(apr_pool_t *pool)
apr_status_t md_json_sets(const char *value, md_json_t *json,...)
void md_log_perror(const char *file, int line, md_log_level_t level, apr_status_t rv, apr_pool_t *p, const char *fmt,...)
int md_log_is_level(apr_pool_t *p, md_log_level_t level)
apr_time_t md_reg_valid_until(md_reg_t *reg, const md_t *md, apr_pool_t *p)
void md_result_activity_printf(md_result_t *result, const char *fmt,...)
void md_result_activity_setn(md_result_t *result, const char *activity)
void md_result_dup(md_result_t *dest, const md_result_t *src)
void md_result_printf(md_result_t *result, apr_status_t status, const char *fmt,...)
void md_result_log(md_result_t *result, unsigned int level)
void md_result_set(md_result_t *result, apr_status_t status, const char *detail)
void md_result_delay_set(md_result_t *result, apr_time_t ready_at)
apr_status_t md_store_save(md_store_t *store, apr_pool_t *p, md_store_group_t group, const char *name, const char *aspect, md_store_vtype_t vtype, void *data, int create)
apr_status_t md_creds_save(md_store_t *store, apr_pool_t *p, md_store_group_t group, const char *name, md_credentials_t *creds, int create)
apr_status_t md_creds_load(md_store_t *store, md_store_group_t group, const char *name, md_pkey_spec_t *spec, md_credentials_t **pcreds, apr_pool_t *p)
apr_status_t md_pubcert_load(md_store_t *store, md_store_group_t group, const char *name, md_pkey_spec_t *spec, struct apr_array_header_t **ppubcert, apr_pool_t *p)
apr_status_t md_pubcert_save(md_store_t *store, apr_pool_t *p, md_store_group_t group, const char *name, md_pkey_spec_t *spec, struct apr_array_header_t *pubcert, int create)
int md_is_newer(md_store_t *store, md_store_group_t group1, md_store_group_t group2, const char *name, apr_pool_t *p)
apr_status_t md_save(md_store_t *store, apr_pool_t *p, md_store_group_t group, md_t *md, int create)
apr_status_t md_store_purge(md_store_t *store, apr_pool_t *p, md_store_group_t group, const char *name)
apr_status_t md_pkey_save(md_store_t *store, apr_pool_t *p, md_store_group_t group, const char *name, md_pkey_spec_t *spec, struct md_pkey_t *pkey, int create)
apr_status_t md_load(md_store_t *store, md_store_group_t group, const char *name, md_t **pmd, apr_pool_t *p)
apr_status_t md_pkey_load(md_store_t *store, md_store_group_t group, const char *name, md_pkey_spec_t *spec, md_pkey_t **ppkey, apr_pool_t *p)
const char * md_duration_format(apr_pool_t *p, apr_interval_time_t duration)
const char * md_link_find_relation(const apr_table_t *headers, apr_pool_t *pool, const char *relation)
apr_status_t md_util_try(md_util_try_fn *fn, void *baton, int ignore_errs, apr_interval_time_t timeout, apr_interval_time_t start_delay, apr_interval_time_t max_delay, int backoff)
int md_array_is_empty(const struct apr_array_header_t *array)
int md_array_str_eq(const struct apr_array_header_t *a1, const struct apr_array_header_t *a2, int case_sensitive)
int md_array_str_index(const apr_array_header_t *array, const char *s, int start, int case_sensitive)
const char * md_util_parse_ct(apr_pool_t *pool, const char *cth)
apr_array_header_t * md_array_str_remove(apr_pool_t *p, apr_array_header_t *src, const char *exclude, int case_sensitive)
apr_array_header_t * md_dns_make_minimal(apr_pool_t *p, apr_array_header_t *domains)
const char * chain_up_link
struct md_credentials_t * cred
struct md_acme_acct_t * acct
struct md_pkey_t * acct_key
struct apr_array_header_t * chain
struct md_pkey_spec_t * spec
const char * ca_effective
struct apr_array_header_t * ca_urls
struct md_pkeys_spec_t * pks
const char * ca_agreement
struct apr_array_header_t * contacts
apr_status_t apr_rfc822_date(char *date_str, apr_time_t t)