diff --git a/jetty-http3/http3-server/src/main/config/modules/http3.mod b/jetty-http3/http3-server/src/main/config/modules/http3.mod index 74d3ebb09ff..eff3d069164 100644 --- a/jetty-http3/http3-server/src/main/config/modules/http3.mod +++ b/jetty-http3/http3-server/src/main/config/modules/http3.mod @@ -12,6 +12,7 @@ experimental http2 jna quiche +work [lib] lib/http3/*.jar diff --git a/jetty-quic/quic-server/src/main/java/org/eclipse/jetty/quic/server/QuicServerConnector.java b/jetty-quic/quic-server/src/main/java/org/eclipse/jetty/quic/server/QuicServerConnector.java index 284768d251d..2cbf0cc843f 100644 --- a/jetty-quic/quic-server/src/main/java/org/eclipse/jetty/quic/server/QuicServerConnector.java +++ b/jetty-quic/quic-server/src/main/java/org/eclipse/jetty/quic/server/QuicServerConnector.java @@ -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 {