@@ -187,11 +187,6 @@ func renewForDomains(ctx *cli.Context, client *lego.Client, certsStorage *Certif
187
187
time .Sleep (sleepTime )
188
188
}
189
189
190
- replacesCertID , err := certificate .MakeARICertID (cert )
191
- if err != nil {
192
- log .Fatalf ("Error while construction the ARI CertID for domain %s\n \t %v" , domain , err )
193
- }
194
-
195
190
request := certificate.ObtainRequest {
196
191
Domains : merge (certDomains , domains ),
197
192
PrivateKey : privateKey ,
@@ -201,7 +196,13 @@ func renewForDomains(ctx *cli.Context, client *lego.Client, certsStorage *Certif
201
196
Bundle : bundle ,
202
197
PreferredChain : ctx .String ("preferred-chain" ),
203
198
AlwaysDeactivateAuthorizations : ctx .Bool ("always-deactivate-authorizations" ),
204
- ReplacesCertID : replacesCertID ,
199
+ }
200
+
201
+ if ctx .Bool ("ari-enable" ) {
202
+ request .ReplacesCertID , err = certificate .MakeARICertID (cert )
203
+ if err != nil {
204
+ log .Fatalf ("Error while construction the ARI CertID for domain %s\n \t %v" , domain , err )
205
+ }
205
206
}
206
207
207
208
certRes , err := client .Certificate .Obtain (request )
@@ -262,19 +263,20 @@ func renewForCSR(ctx *cli.Context, client *lego.Client, certsStorage *Certificat
262
263
timeLeft := cert .NotAfter .Sub (time .Now ().UTC ())
263
264
log .Infof ("[%s] acme: Trying renewal with %d hours remaining" , domain , int (timeLeft .Hours ()))
264
265
265
- replacesCertID , err := certificate .MakeARICertID (cert )
266
- if err != nil {
267
- log .Fatalf ("Error while construction the ARI CertID for domain %s\n \t %v" , domain , err )
268
- }
269
-
270
266
request := certificate.ObtainForCSRRequest {
271
267
CSR : csr ,
272
268
NotBefore : getTime (ctx , "not-before" ),
273
269
NotAfter : getTime (ctx , "not-after" ),
274
270
Bundle : bundle ,
275
271
PreferredChain : ctx .String ("preferred-chain" ),
276
272
AlwaysDeactivateAuthorizations : ctx .Bool ("always-deactivate-authorizations" ),
277
- ReplacesCertID : replacesCertID ,
273
+ }
274
+
275
+ if ctx .Bool ("ari-enable" ) {
276
+ request .ReplacesCertID , err = certificate .MakeARICertID (cert )
277
+ if err != nil {
278
+ log .Fatalf ("Error while construction the ARI CertID for domain %s\n \t %v" , domain , err )
279
+ }
278
280
}
279
281
280
282
certRes , err := client .Certificate .ObtainForCSR (request )
0 commit comments