File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -395,16 +395,19 @@ func (certCache *Cache) AllMatchingCertificates(name string) []Certificate {
395
395
}
396
396
397
397
// RemoveManaged removes managed certificates for the given subjects from the cache.
398
- // This effectively stops maintenance of those certificates.
399
- func (certCache * Cache ) RemoveManaged (subjects []string ) {
398
+ // This effectively stops maintenance of those certificates. Optionally pass an issuer
399
+ // key to remove only certs managed with a certain issuer.
400
+ func (certCache * Cache ) RemoveManaged (subjects []string , issuerKey string ) {
400
401
deleteQueue := make ([]string , 0 , len (subjects ))
401
402
for _ , subject := range subjects {
402
403
certs := certCache .getAllMatchingCerts (subject ) // does NOT expand wildcards; exact matches only
403
404
for _ , cert := range certs {
404
405
if ! cert .managed {
405
406
continue
406
407
}
407
- deleteQueue = append (deleteQueue , cert .hash )
408
+ if issuerKey == "" || cert .issuerKey == issuerKey {
409
+ deleteQueue = append (deleteQueue , cert .hash )
410
+ }
408
411
}
409
412
}
410
413
certCache .Remove (deleteQueue )
You can’t perform that action at this time.
0 commit comments