feat: Verify chain of trust on generated certificates #14

Merged
MarkL4YG merged 3 commits from feat/chain-verification into main 2024-11-22 11:57:23 +00:00
Showing only changes of commit 4928da2336 - Show all commits

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);