chore: Kill genCert on error

- Because apparently it can run into an infinite loop when there are pKey issues
This commit is contained in:
Magnus Leßmann (@MarkL4YG) 2024-11-23 13:20:14 +01:00
parent 003b9915a3
commit a059a60886

View file

@ -393,8 +393,9 @@ public class OpenSSLCertificateCreator {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
StartedProcess certGenProc = null;
try { try {
StartedProcess certGenProc = new ProcessExecutor() certGenProc = new ProcessExecutor()
.command( .command(
resolveOpenSSL(), resolveOpenSSL(),
"x509", "x509",
@ -421,6 +422,8 @@ public class OpenSSLCertificateCreator {
throw new CommandLineOperationException("Failure running OpenSSL x509 command.", e); throw new CommandLineOperationException("Failure running OpenSSL x509 command.", e);
} catch (ExecutionException e) { } catch (ExecutionException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} finally {
killIfActive(certGenProc);
} }
return outFile; return outFile;
} }