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

Function md_acme_setup

modules/md/md_acme.c:784–823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

782}
783
784apr_status_t md_acme_setup(md_acme_t *acme, md_result_t *result)
785{
786 apr_status_t rv;
787 update_dir_ctx ctx;
788
789 assert(acme->url);
790 acme->version = MD_ACME_VERSION_UNKNOWN;
791
792 if (!acme->http && APR_SUCCESS != (rv = md_http_create(&acme->http, acme->p,
793 acme->user_agent, acme->proxy_url))) {
794 return rv;
795 }
796 /* TODO: maybe this should be configurable. Let's take some reasonable
797 * defaults for now that protect our client */
798 md_http_set_response_limit(acme->http, 1024*1024);
799 md_http_set_timeout_default(acme->http, apr_time_from_sec(10 * 60));
800 md_http_set_connect_timeout_default(acme->http, apr_time_from_sec(30));
801 md_http_set_stalling_default(acme->http, 10, apr_time_from_sec(30));
802 md_http_set_ca_file(acme->http, acme->ca_file);
803
804 md_log_perror(MD_LOG_MARK, MD_LOG_DEBUG, 0, acme->p, "get directory from %s", acme->url);
805
806 ctx.acme = acme;
807 ctx.result = result;
808 rv = md_http_GET_perform(acme->http, acme->url, NULL, update_directory, &ctx);
809
810 if (APR_SUCCESS != rv && APR_SUCCESS == result->status) {
811 /* If the result reports no error, we never got a response from the server */
812 md_result_printf(result, rv,
813 "Unsuccessful in contacting ACME server at <%s>. If this problem persists, "
814 "please check your network connectivity from your Apache server to the "
815 "ACME server. Also, older servers might have trouble verifying the certificates "
816 "of the ACME server. You can check if you are able to contact it manually via the "
817 "curl command. Sometimes, the ACME server might be down for maintenance, "
818 "so failing to contact it is not an immediate problem. Apache will "
819 "continue retrying this.", acme->url);
820 md_result_log(result, MD_LOG_WARNING);
821 }
822 return rv;
823}
824
825

Callers 3

acme_renewFunction · 0.85
acme_get_ariFunction · 0.85
md_acme_req_sendFunction · 0.85

Calls 10

md_http_createFunction · 0.85
md_http_set_ca_fileFunction · 0.85
md_log_perrorFunction · 0.85
md_http_GET_performFunction · 0.85
md_result_printfFunction · 0.85
md_result_logFunction · 0.85

Tested by

no test coverage detected