#9772 improve QuicServerConnector key+crt export folder
Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
parent
b24c180749
commit
07a1c124f2
|
@ -12,6 +12,7 @@ experimental
|
|||
http2
|
||||
jna
|
||||
quiche
|
||||
work
|
||||
|
||||
[lib]
|
||||
lib/http3/*.jar
|
||||
|
|
|
@ -174,11 +174,28 @@ public class QuicServerConnector extends AbstractNetworkConnector
|
|||
alias,
|
||||
password
|
||||
);
|
||||
Path[] pemFiles = keyPair.export(Path.of(System.getProperty("java.io.tmpdir")));
|
||||
Path[] pemFiles = keyPair.export(findTargetPath());
|
||||
privateKeyPath = pemFiles[0];
|
||||
certificateChainPath = pemFiles[1];
|
||||
}
|
||||
|
||||
private Path findTargetPath() throws IOException
|
||||
{
|
||||
Path target;
|
||||
String jettyBase = System.getProperty("jetty.base");
|
||||
if (jettyBase != null)
|
||||
{
|
||||
target = Path.of(jettyBase).resolve("work");
|
||||
}
|
||||
else
|
||||
{
|
||||
target = sslContextFactory.getKeyStoreResource().getFile().getParentFile().toPath();
|
||||
if (!Files.isDirectory(target))
|
||||
target = Path.of(".");
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open() throws IOException
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue