feat: Tertiary full chain supprt

- Technically, CAs and intermediate CAs do not use "fullchain" certificates, but it is useful to us to include the entire certificate chain in the leaf certificate
This commit is contained in:
Magnus Leßmann (@MarkL4YG) 2024-11-22 12:55:05 +01:00
parent c7f05f1337
commit b39242baba

View file

@ -106,7 +106,10 @@ public class OpenSSLCertificateCreator {
Path fullchain = tmpDir.resolve("fullchain.pem");
try {
Files.write(fullchain, Files.readAllBytes(certAuthority.certificatePath()), StandardOpenOption.CREATE);
Path certAuthFullchain = Optional
.ofNullable(certAuthority.fullchainPath())
.orElse(certAuthority.certificatePath());
Files.write(fullchain, Files.readAllBytes(certAuthFullchain), StandardOpenOption.CREATE);
Files.write(fullchain, Files.readAllBytes(signedCert), StandardOpenOption.APPEND);
} catch (IOException e) {
throw new CommandLineOperationException("Failed to create fullchain file.", e);