@@ -212,29 +212,11 @@ async fn ngx_http_acme_update_certificates(amcf: &AcmeMainConfig) -> Time {
212
212
let issuer_next = match ngx_http_acme_update_certificates_for_issuer ( amcf, issuer) . await {
213
213
Ok ( x) => x,
214
214
Err ( err) => {
215
- // Check if the server rejected this ACME account configuration.
216
- if err
217
- . downcast_ref :: < acme:: error:: NewAccountError > ( )
218
- . is_some_and ( |err| err. is_invalid ( ) )
219
- {
220
- ngx_log_error ! (
221
- NGX_LOG_ERR ,
222
- log. as_ptr( ) ,
223
- "acme issuer \" {}\" is not valid: {}" ,
224
- issuer. name,
225
- err
226
- ) ;
227
-
228
- issuer. set_invalid ( err. as_ref ( ) ) ;
229
- continue ;
230
- }
231
-
232
215
ngx_log_error ! (
233
- NGX_LOG_INFO ,
216
+ NGX_LOG_WARN ,
234
217
log. as_ptr( ) ,
235
- "update failed for acme issuer \" {}\" : {}" ,
236
- issuer. name,
237
- err
218
+ "{err} while processing renewals for acme issuer \" {}\" " ,
219
+ issuer. name
238
220
) ;
239
221
now + ACME_DEFAULT_INTERVAL
240
222
}
@@ -301,7 +283,44 @@ async fn ngx_http_acme_update_certificates_for_issuer(
301
283
}
302
284
303
285
if !client. is_ready ( ) {
304
- client. new_account ( ) . await ?;
286
+ match client. new_account ( ) . await {
287
+ Ok ( acme:: NewAccountOutput :: Created ( x) ) => {
288
+ ngx_log_error ! (
289
+ NGX_LOG_INFO ,
290
+ log. as_ptr( ) ,
291
+ "account \" {}\" created for acme issuer \" {}\" " ,
292
+ x,
293
+ issuer. name
294
+ ) ;
295
+ }
296
+ Ok ( acme:: NewAccountOutput :: Found ( x) ) => {
297
+ ngx_log_debug ! (
298
+ log. as_ptr( ) ,
299
+ "account \" {}\" found for acme issuer \" {}\" " ,
300
+ x,
301
+ issuer. name
302
+ ) ;
303
+ }
304
+ Err ( err) if err. is_invalid ( ) => {
305
+ ngx_log_error ! (
306
+ NGX_LOG_ERR ,
307
+ log. as_ptr( ) ,
308
+ "{err} while creating account for acme issuer \" {}\" " ,
309
+ issuer. name
310
+ ) ;
311
+ issuer. set_invalid ( & err) ;
312
+ return Ok ( Time :: MAX ) ;
313
+ }
314
+ Err ( err) => {
315
+ ngx_log_error ! (
316
+ NGX_LOG_WARN ,
317
+ log. as_ptr( ) ,
318
+ "{err} while creating account for acme issuer \" {}\" " ,
319
+ issuer. name
320
+ ) ;
321
+ return Ok ( issuer. set_error ( & err) ) ;
322
+ }
323
+ }
305
324
}
306
325
307
326
let alloc = crate :: util:: OwnedPool :: new ( nginx_sys:: NGX_DEFAULT_POOL_SIZE as _ , log)
0 commit comments