static struct acme_cfg *acme_cfgs = NULL;
static struct acme_cfg *cur_acme = NULL;
+static struct proxy *httpclient_acme_px = NULL;
+
/* Return an existing acme_cfg section */
struct acme_cfg *get_acme_cfg(const char *name)
{
return err_code;
}
+/* Initialize the proxy for the ACME HTTP client */
+static int httpclient_acme_init()
+{
+ httpclient_acme_px = httpclient_create_proxy("<ACME>");
+ if (!httpclient_acme_px)
+ return ERR_FATAL;
+ httpclient_acme_px->logformat.str = httpsclient_log_format; /* ACME server are always SSL */
+
+ return ERR_NONE;
+}
+
/* acme section parser
* Fill the acme_cfgs linked list
goto out;
}
+ if (httpclient_acme_px == NULL) {
+ if (httpclient_acme_init() & ERR_FATAL) {
+ err_code |= ERR_ALERT | ERR_FATAL;
+ ha_alert("parsing [%s:%d]: out of memory.\n", file, linenum);
+ goto out;
+ }
+ }
+
cur_acme = new_acme_cfg(args[1]);
if (!cur_acme) {
err_code |= ERR_ALERT | ERR_FATAL;
{
struct httpclient *hc;
- hc = httpclient_new(task, meth, url);
+ hc = httpclient_new_from_proxy(httpclient_acme_px, task, meth, url);
if (!hc)
goto error;