Keep alternate certificate instances

pull/140/head
Richard Körber 2023-05-20 17:19:12 +02:00
parent d9894f42eb
commit 7f20545e14
No known key found for this signature in database
GPG Key ID: AAB9FD19C78AA3E0
1 changed files with 8 additions and 4 deletions

View File

@ -59,6 +59,7 @@ public class Certificate extends AcmeResource {
private @Nullable List<X509Certificate> certChain;
private @Nullable Collection<URL> alternates;
private transient @Nullable RenewalInfo renewalInfo = null;
private transient @Nullable List<Certificate> alternateCerts = null;
protected Certificate(Login login, URL certUrl) {
super(login, certUrl);
@ -124,10 +125,13 @@ public class Certificate extends AcmeResource {
* @since 2.11
*/
public List<Certificate> getAlternateCertificates() {
var login = getLogin();
return getAlternates().stream()
.map(login::bindCertificate)
.collect(toUnmodifiableList());
if (alternateCerts == null) {
var login = getLogin();
alternateCerts = getAlternates().stream()
.map(login::bindCertificate)
.collect(toUnmodifiableList());
}
return alternateCerts;
}
/**