@@ -81,7 +81,7 @@ static apr_status_t problem_status_get(const char *type) {
8181 }
8282
8383 for (i = 0 ; i < (sizeof (Problems )/sizeof (Problems [0 ])); ++ i ) {
84- if (!apr_strnatcasecmp (type , Problems [i ].type )) {
84+ if (!apr_cstr_casecmp (type , Problems [i ].type )) {
8585 return Problems [i ].rv ;
8686 }
8787 }
@@ -100,7 +100,7 @@ int md_acme_problem_is_input_related(const char *problem) {
100100 }
101101
102102 for (i = 0 ; i < (sizeof (Problems )/sizeof (Problems [0 ])); ++ i ) {
103- if (!apr_strnatcasecmp (problem , Problems [i ].type )) {
103+ if (!apr_cstr_casecmp (problem , Problems [i ].type )) {
104104 return Problems [i ].input_related ;
105105 }
106106 }
@@ -332,7 +332,7 @@ static apr_status_t acmev2_GET_as_POST_init(md_acme_req_t *req, void *baton)
332332 return md_acme_req_body_init (req , NULL );
333333}
334334
335- static apr_status_t md_acme_req_send (md_acme_req_t * req )
335+ static apr_status_t md_acme_req_send (md_acme_req_t * req , int get_as_post )
336336{
337337 apr_status_t rv ;
338338 md_acme_t * acme = req -> acme ;
@@ -352,7 +352,7 @@ static apr_status_t md_acme_req_send(md_acme_req_t *req)
352352 if (APR_SUCCESS != rv ) goto leave ;
353353 }
354354
355- if (!strcmp ("GET" , req -> method ) && !req -> on_init && !req -> req_json ) {
355+ if (get_as_post && !strcmp ("GET" , req -> method ) && !req -> on_init && !req -> req_json ) {
356356 /* See <https://ietf-wg-acme.github.io/acme/draft-ietf-acme-acme.html#rfc.section.6.3>
357357 * and <https://mailarchive.ietf.org/arch/msg/acme/sotffSQ0OWV-qQJodLwWYWcEVKI>
358358 * and <https://community.letsencrypt.org/t/acme-v2-scheduled-deprecation-of-unauthenticated-resource-gets/74380>
@@ -420,7 +420,7 @@ static apr_status_t md_acme_req_send(md_acme_req_t *req)
420420
421421 if (APR_EAGAIN == rv && req -> max_retries > 0 ) {
422422 -- req -> max_retries ;
423- rv = md_acme_req_send (req );
423+ rv = md_acme_req_send (req , 1 );
424424 }
425425 req = NULL ;
426426
@@ -449,14 +449,15 @@ apr_status_t md_acme_POST(md_acme_t *acme, const char *url,
449449 req -> on_err = on_err ;
450450 req -> baton = baton ;
451451
452- return md_acme_req_send (req );
452+ return md_acme_req_send (req , 1 );
453453}
454454
455455apr_status_t md_acme_GET (md_acme_t * acme , const char * url ,
456456 md_acme_req_init_cb * on_init ,
457457 md_acme_req_json_cb * on_json ,
458458 md_acme_req_res_cb * on_res ,
459- md_acme_req_err_cb * on_err ,
459+ md_acme_req_err_cb * on_err ,
460+ int get_as_post ,
460461 void * baton )
461462{
462463 md_acme_req_t * req ;
@@ -472,7 +473,7 @@ apr_status_t md_acme_GET(md_acme_t *acme, const char *url,
472473 req -> on_err = on_err ;
473474 req -> baton = baton ;
474475
475- return md_acme_req_send (req );
476+ return md_acme_req_send (req , get_as_post );
476477}
477478
478479void md_acme_report_result (md_acme_t * acme , apr_status_t rv , struct md_result_t * result )
@@ -507,15 +508,15 @@ static apr_status_t on_got_json(md_acme_t *acme, apr_pool_t *p, const apr_table_
507508}
508509
509510apr_status_t md_acme_get_json (struct md_json_t * * pjson , md_acme_t * acme ,
510- const char * url , apr_pool_t * p )
511+ const char * url , int get_as_post , apr_pool_t * p )
511512{
512513 apr_status_t rv ;
513514 json_ctx ctx ;
514515
515516 ctx .pool = p ;
516517 ctx .json = NULL ;
517518
518- rv = md_acme_GET (acme , url , NULL , on_got_json , NULL , NULL , & ctx );
519+ rv = md_acme_GET (acme , url , NULL , on_got_json , NULL , NULL , get_as_post , & ctx );
519520 * pjson = (APR_SUCCESS == rv )? ctx .json : NULL ;
520521 return rv ;
521522}
@@ -720,6 +721,7 @@ static apr_status_t update_directory(const md_http_response_t *res, void *data)
720721 acme -> api .v2 .revoke_cert = md_json_dups (acme -> p , json , "revokeCert" , NULL );
721722 acme -> api .v2 .key_change = md_json_dups (acme -> p , json , "keyChange" , NULL );
722723 acme -> api .v2 .new_nonce = md_json_dups (acme -> p , json , "newNonce" , NULL );
724+ acme -> api .v2 .renewal_info = md_json_dups (acme -> p , json , "renewalInfo" , NULL );
723725 /* RFC 8555 only requires "directory" and "newNonce" resources.
724726 * mod_md uses "newAccount" and "newOrder" so check for them.
725727 * But mod_md does not use the "revokeCert" or "keyChange"
0 commit comments