From 9bb92f81bd5206c3597889644a1dded127760e22 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Tue, 3 Mar 2020 15:16:20 +0100 Subject: [PATCH 1/4] Issue #4443 - Track backport of ALPN APIs to Java 8. Modified jetty-alpn-openjdk8-* classes to support both pre 8u252 (via alpn-boot) and post 8u252 (via standard API). Replaced usages of -Xbootclasspath with -javaagent, and using Jetty ALPN Agent jar rather than Jetty ALPN boot jar. Removed all alpn-1.8.0*.mod files since now it is possible to use a fixed version of the ALPN Agent to cover all the versions. Signed-off-by: Simone Bordet --- examples/embedded/pom.xml | 2 +- jetty-alpn/jetty-alpn-java-client/pom.xml | 4 +- jetty-alpn/jetty-alpn-java-server/pom.xml | 9 +- jetty-alpn/jetty-alpn-openjdk8-client/pom.xml | 1 + .../client/OpenJDK8ClientALPNProcessor.java | 78 ++- .../server/OpenJDK8ServerALPNProcessor.java | 89 ++- .../config/modules/alpn-impl/alpn-1.8.0.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_05.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_101.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_102.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_11.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_111.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_112.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_121.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_131.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_141.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_144.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_151.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_152.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_161.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_162.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_171.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_172.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_181.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_191.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_192.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_20.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_201.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_202.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_211.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_212.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_221.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_222.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_231.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_232.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_241.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_242.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_25.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_31.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_40.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_45.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_51.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_60.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_65.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_66.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_71.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_72.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_73.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_74.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_77.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_91.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_92.mod | 7 - .../main/config/modules/alpn-impl/alpn-8.mod | 33 +- jetty-alpn/pom.xml | 2 +- jetty-home/pom.xml | 2 +- jetty-http-spi/pom.xml | 2 +- jetty-http2/http2-alpn-tests/pom.xml | 43 +- .../http2-http-client-transport/pom.xml | 25 +- jetty-http2/pom.xml | 3 +- .../src/it/jetty-deploy-war-mojo-it/pom.xml | 2 +- jetty-osgi/test-jetty-osgi/pom.xml | 15 +- .../osgi/test/TestJettyOSGiBootHTTP2.java | 34 +- .../jetty/server/DetectorConnectionTest.java | 12 +- .../java/org/eclipse/jetty/start/Modules.java | 22 +- .../modules/alpn-impl/alpn-1.8.0_101.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_102.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_111.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_112.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_121.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_131.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_141.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_144.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_151.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_152.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_161.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_162.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_171.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_172.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_181.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_191.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_192.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_201.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_202.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_211.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_212.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_221.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_222.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_231.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_232.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_241.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_242.mod | 7 - .../modules/alpn-impl/alpn-1.8.0_91.mod | 5 - .../modules/alpn-impl/alpn-1.8.0_92.mod | 5 - jetty-webapp/pom.xml | 2 +- pom.xml | 561 +----------------- tests/test-http-client-transport/pom.xml | 72 +-- tests/test-webapps/test-http2-webapp/pom.xml | 25 +- 97 files changed, 305 insertions(+), 1208 deletions(-) delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_05.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_101.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_102.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_11.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_111.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_112.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_121.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_131.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_141.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_144.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_151.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_152.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_161.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_162.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_171.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_172.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_181.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_191.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_192.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_20.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_201.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_202.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_211.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_212.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_221.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_222.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_231.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_232.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_241.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_242.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_25.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_31.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_40.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_45.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_51.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_60.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_65.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_66.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_71.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_72.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_73.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_74.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_77.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_91.mod delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_92.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_101.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_102.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_111.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_112.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_121.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_131.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_141.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_144.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_151.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_152.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_161.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_162.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_171.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_172.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_181.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_191.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_192.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_201.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_202.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_211.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_212.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_221.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_222.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_231.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_232.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_241.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_242.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_91.mod delete mode 100644 jetty-start/src/test/resources/dist-home/modules/alpn-impl/alpn-1.8.0_92.mod diff --git a/examples/embedded/pom.xml b/examples/embedded/pom.xml index 35b277a27d4..25fa3bf60c9 100644 --- a/examples/embedded/pom.xml +++ b/examples/embedded/pom.xml @@ -171,7 +171,7 @@ jdk9 - [1.9,) + [9,) diff --git a/jetty-alpn/jetty-alpn-java-client/pom.xml b/jetty-alpn/jetty-alpn-java-client/pom.xml index f9a6a2ad6d6..cd38c4a9069 100644 --- a/jetty-alpn/jetty-alpn-java-client/pom.xml +++ b/jetty-alpn/jetty-alpn-java-client/pom.xml @@ -20,8 +20,8 @@ maven-compiler-plugin - 1.9 - 1.9 + 9 + 9 9 diff --git a/jetty-alpn/jetty-alpn-java-server/pom.xml b/jetty-alpn/jetty-alpn-java-server/pom.xml index 1b5c5434786..5582dccfa56 100644 --- a/jetty-alpn/jetty-alpn-java-server/pom.xml +++ b/jetty-alpn/jetty-alpn-java-server/pom.xml @@ -19,8 +19,8 @@ maven-compiler-plugin - 1.9 - 1.9 + 9 + 9 9 @@ -46,11 +46,6 @@ jetty-io ${project.version} - - org.eclipse.jetty.alpn - alpn-api - ${alpn.api.version} - org.eclipse.jetty jetty-alpn-server diff --git a/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml b/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml index 9c98b9807f8..a76767a2f0a 100644 --- a/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml +++ b/jetty-alpn/jetty-alpn-openjdk8-client/pom.xml @@ -25,6 +25,7 @@ org.eclipse.jetty.alpn alpn-api ${alpn.api.version} + provided org.eclipse.jetty.http2 diff --git a/jetty-alpn/jetty-alpn-openjdk8-client/src/main/java/org/eclipse/jetty/alpn/openjdk8/client/OpenJDK8ClientALPNProcessor.java b/jetty-alpn/jetty-alpn-openjdk8-client/src/main/java/org/eclipse/jetty/alpn/openjdk8/client/OpenJDK8ClientALPNProcessor.java index bc6ee6c523d..28557b64e45 100644 --- a/jetty-alpn/jetty-alpn-openjdk8-client/src/main/java/org/eclipse/jetty/alpn/openjdk8/client/OpenJDK8ClientALPNProcessor.java +++ b/jetty-alpn/jetty-alpn-openjdk8-client/src/main/java/org/eclipse/jetty/alpn/openjdk8/client/OpenJDK8ClientALPNProcessor.java @@ -18,13 +18,20 @@ package org.eclipse.jetty.alpn.openjdk8.client; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.List; import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLParameters; import org.eclipse.jetty.alpn.ALPN; import org.eclipse.jetty.alpn.client.ALPNClientConnection; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.ssl.ALPNProcessor; +import org.eclipse.jetty.io.ssl.SslConnection; +import org.eclipse.jetty.io.ssl.SslHandshakeListener; import org.eclipse.jetty.util.JavaVersion; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -33,11 +40,28 @@ public class OpenJDK8ClientALPNProcessor implements ALPNProcessor.Client { private static final Logger LOG = Log.getLogger(OpenJDK8ClientALPNProcessor.class); + private Method alpnProtocols; + private Method alpnProtocol; + @Override public void init() { if (JavaVersion.VERSION.getPlatform() != 8) throw new IllegalStateException(this + " not applicable for java " + JavaVersion.VERSION); + + try + { + // JDK 8u252 has the JDK 9 ALPN API backported. + // Use reflection so we can build with a JDK version less than 8u252. + alpnProtocols = SSLParameters.class.getMethod("setApplicationProtocols", String[].class); + alpnProtocol = SSLEngine.class.getMethod("getApplicationProtocol"); + return; + } + catch (NoSuchMethodException ignored) + { + } + + // Backported ALPN APIs not available. if (ALPN.class.getClassLoader() != null) throw new IllegalStateException(ALPN.class.getName() + " must be on JVM boot classpath"); if (LOG.isDebugEnabled()) @@ -53,14 +77,34 @@ public class OpenJDK8ClientALPNProcessor implements ALPNProcessor.Client @Override public void configure(SSLEngine sslEngine, Connection connection) { - connection.addListener(new ALPNListener((ALPNClientConnection)connection)); + ALPNClientConnection alpnConnection = (ALPNClientConnection)connection; + if (alpnProtocols == null) + { + connection.addListener(new ALPNConnectionListener(alpnConnection)); + } + else + { + try + { + Object protocols = alpnConnection.getProtocols().toArray(new String[0]); + SSLParameters sslParameters = sslEngine.getSSLParameters(); + alpnProtocols.invoke(sslParameters, protocols); + sslEngine.setSSLParameters(sslParameters); + ((SslConnection.DecryptedEndPoint)connection.getEndPoint()).getSslConnection() + .addHandshakeListener(new ALPNSSLListener(alpnConnection)); + } + catch (IllegalAccessException | InvocationTargetException x) + { + throw new IllegalStateException(this + " unable to set ALPN protocols", x); + } + } } - private final class ALPNListener implements ALPN.ClientProvider, Connection.Listener + private static final class ALPNConnectionListener implements ALPN.ClientProvider, Connection.Listener { private final ALPNClientConnection alpnConnection; - private ALPNListener(ALPNClientConnection connection) + private ALPNConnectionListener(ALPNClientConnection connection) { alpnConnection = connection; } @@ -102,4 +146,32 @@ public class OpenJDK8ClientALPNProcessor implements ALPNProcessor.Client alpnConnection.selected(protocol); } } + + private final class ALPNSSLListener implements SslHandshakeListener + { + private final ALPNClientConnection alpnConnection; + + private ALPNSSLListener(ALPNClientConnection connection) + { + alpnConnection = connection; + } + + @Override + public void handshakeSucceeded(Event event) throws SSLException + { + try + { + SSLEngine sslEngine = alpnConnection.getSSLEngine(); + String protocol = (String)alpnProtocol.invoke(sslEngine); + if (LOG.isDebugEnabled()) + LOG.debug("selected protocol {}", protocol); + alpnConnection.selected(protocol); + } + catch (IllegalAccessException | InvocationTargetException x) + { + SSLHandshakeException failure = new SSLHandshakeException(this + " unable to get ALPN protocol"); + throw (SSLHandshakeException)failure.initCause(x); + } + } + } } diff --git a/jetty-alpn/jetty-alpn-openjdk8-server/src/main/java/org/eclipse/jetty/alpn/openjdk8/server/OpenJDK8ServerALPNProcessor.java b/jetty-alpn/jetty-alpn-openjdk8-server/src/main/java/org/eclipse/jetty/alpn/openjdk8/server/OpenJDK8ServerALPNProcessor.java index b2668c6391a..552e98673d6 100644 --- a/jetty-alpn/jetty-alpn-openjdk8-server/src/main/java/org/eclipse/jetty/alpn/openjdk8/server/OpenJDK8ServerALPNProcessor.java +++ b/jetty-alpn/jetty-alpn-openjdk8-server/src/main/java/org/eclipse/jetty/alpn/openjdk8/server/OpenJDK8ServerALPNProcessor.java @@ -18,15 +18,19 @@ package org.eclipse.jetty.alpn.openjdk8.server; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.util.Collections; import java.util.List; +import java.util.function.BiFunction; import javax.net.ssl.SSLEngine; -import javax.net.ssl.SSLException; import org.eclipse.jetty.alpn.ALPN; import org.eclipse.jetty.alpn.server.ALPNServerConnection; import org.eclipse.jetty.io.Connection; import org.eclipse.jetty.io.ssl.ALPNProcessor; +import org.eclipse.jetty.io.ssl.SslConnection; +import org.eclipse.jetty.io.ssl.SslHandshakeListener; import org.eclipse.jetty.util.JavaVersion; import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; @@ -35,11 +39,26 @@ public class OpenJDK8ServerALPNProcessor implements ALPNProcessor.Server { private static final Logger LOG = Log.getLogger(OpenJDK8ServerALPNProcessor.class); + private Method alpnSelector; + @Override public void init() { if (JavaVersion.VERSION.getPlatform() != 8) throw new IllegalStateException(this + " not applicable for java " + JavaVersion.VERSION); + + try + { + // JDK 8u252 has the JDK 9 ALPN API backported. + // Use reflection so we can build with a JDK version less than 8u252. + alpnSelector = SSLEngine.class.getMethod("setHandshakeApplicationProtocolSelector", BiFunction.class); + return; + } + catch (NoSuchMethodException ignored) + { + } + + // Backported ALPN APIs not available. if (ALPN.class.getClassLoader() != null) throw new IllegalStateException(ALPN.class.getName() + " must be on JVM boot classpath"); if (LOG.isDebugEnabled()) @@ -55,10 +74,26 @@ public class OpenJDK8ServerALPNProcessor implements ALPNProcessor.Server @Override public void configure(SSLEngine sslEngine, Connection connection) { - connection.addListener(new ALPNListener((ALPNServerConnection)connection)); + if (alpnSelector == null) + { + ALPNListener listener = new ALPNListener((ALPNServerConnection)connection); + connection.addListener(listener); + } + else + { + try + { + ALPNCallback callback = new ALPNCallback((ALPNServerConnection)connection); + alpnSelector.invoke(sslEngine, callback); + } + catch (IllegalAccessException | InvocationTargetException x) + { + throw new IllegalStateException(this + " unable to set ALPN selector", x); + } + } } - private final class ALPNListener implements ALPN.ServerProvider, Connection.Listener + private static final class ALPNListener implements ALPN.ServerProvider, Connection.Listener { private final ALPNServerConnection alpnConnection; @@ -92,7 +127,7 @@ public class OpenJDK8ServerALPNProcessor implements ALPNProcessor.Server } @Override - public String select(List protocols) throws SSLException + public String select(List protocols) { if (LOG.isDebugEnabled()) LOG.debug("select {} {}", alpnConnection, protocols); @@ -100,4 +135,50 @@ public class OpenJDK8ServerALPNProcessor implements ALPNProcessor.Server return alpnConnection.getProtocol(); } } + + private static class ALPNCallback implements BiFunction, String>, SslHandshakeListener + { + private final ALPNServerConnection alpnConnection; + + private ALPNCallback(ALPNServerConnection connection) + { + alpnConnection = connection; + ((SslConnection.DecryptedEndPoint)alpnConnection.getEndPoint()).getSslConnection().addHandshakeListener(this); + } + + @Override + public String apply(SSLEngine engine, List protocols) + { + try + { + if (LOG.isDebugEnabled()) + LOG.debug("apply {} {}", alpnConnection, protocols); + alpnConnection.select(protocols); + return alpnConnection.getProtocol(); + } + catch (Throwable x) + { + // Cannot negotiate the protocol, return null to have + // JSSE send Alert.NO_APPLICATION_PROTOCOL to the client. + return null; + } + } + + @Override + public void handshakeSucceeded(Event event) + { + String protocol = alpnConnection.getProtocol(); + if (LOG.isDebugEnabled()) + LOG.debug("TLS handshake succeeded, protocol={} for {}", protocol, alpnConnection); + if (protocol == null) + alpnConnection.unsupported(); + } + + @Override + public void handshakeFailed(Event event, Throwable failure) + { + if (LOG.isDebugEnabled()) + LOG.debug("TLS handshake failed " + alpnConnection, failure); + } + } } diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0.mod deleted file mode 100644 index bbcca55ad48..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.0.v20141016|lib/alpn/alpn-boot-8.1.0.v20141016.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_05.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_05.mod deleted file mode 100644 index bbcca55ad48..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_05.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.0.v20141016|lib/alpn/alpn-boot-8.1.0.v20141016.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_101.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_101.mod deleted file mode 100644 index 98e9460dd1a..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_101.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.9.v20160720|lib/alpn/alpn-boot-8.1.9.v20160720.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_102.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_102.mod deleted file mode 100644 index 98e9460dd1a..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_102.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.9.v20160720|lib/alpn/alpn-boot-8.1.9.v20160720.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_11.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_11.mod deleted file mode 100644 index bbcca55ad48..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_11.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.0.v20141016|lib/alpn/alpn-boot-8.1.0.v20141016.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_111.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_111.mod deleted file mode 100644 index 98e9460dd1a..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_111.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.9.v20160720|lib/alpn/alpn-boot-8.1.9.v20160720.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.9.v20160720.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_112.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_112.mod deleted file mode 100644 index 8d4ac37b4f4..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_112.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.10.v20161026|lib/alpn/alpn-boot-8.1.10.v20161026.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.10.v20161026.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_121.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_121.mod deleted file mode 100644 index 7a3a9192362..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_121.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.11.v20170118|lib/alpn/alpn-boot-8.1.11.v20170118.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_131.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_131.mod deleted file mode 100644 index 7a3a9192362..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_131.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.11.v20170118|lib/alpn/alpn-boot-8.1.11.v20170118.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_141.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_141.mod deleted file mode 100644 index 7a3a9192362..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_141.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.11.v20170118|lib/alpn/alpn-boot-8.1.11.v20170118.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_144.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_144.mod deleted file mode 100644 index 7a3a9192362..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_144.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.11.v20170118|lib/alpn/alpn-boot-8.1.11.v20170118.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_151.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_151.mod deleted file mode 100644 index 7a3a9192362..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_151.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.11.v20170118|lib/alpn/alpn-boot-8.1.11.v20170118.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_152.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_152.mod deleted file mode 100644 index 7a3a9192362..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_152.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.11.v20170118|lib/alpn/alpn-boot-8.1.11.v20170118.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.11.v20170118.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_161.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_161.mod deleted file mode 100644 index 00366a87b3d..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_161.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.12.v20180117|lib/alpn/alpn-boot-8.1.12.v20180117.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_162.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_162.mod deleted file mode 100644 index 00366a87b3d..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_162.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.12.v20180117|lib/alpn/alpn-boot-8.1.12.v20180117.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_171.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_171.mod deleted file mode 100644 index 00366a87b3d..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_171.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.12.v20180117|lib/alpn/alpn-boot-8.1.12.v20180117.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_172.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_172.mod deleted file mode 100644 index 00366a87b3d..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_172.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.12.v20180117|lib/alpn/alpn-boot-8.1.12.v20180117.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_181.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_181.mod deleted file mode 100644 index 00366a87b3d..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_181.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.12.v20180117|lib/alpn/alpn-boot-8.1.12.v20180117.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.12.v20180117.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_191.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_191.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_191.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_192.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_192.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_192.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_20.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_20.mod deleted file mode 100644 index bbcca55ad48..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_20.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.0.v20141016|lib/alpn/alpn-boot-8.1.0.v20141016.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.0.v20141016.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_201.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_201.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_201.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_202.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_202.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_202.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_211.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_211.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_211.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_212.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_212.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_212.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_221.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_221.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_221.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_222.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_222.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_222.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_231.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_231.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_231.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_232.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_232.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_232.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_241.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_241.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_241.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_242.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_242.mod deleted file mode 100644 index ed8a55508d6..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_242.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.13.v20181017|lib/alpn/alpn-boot-8.1.13.v20181017.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.13.v20181017.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_25.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_25.mod deleted file mode 100644 index f34b1841244..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_25.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.2.v20141202|lib/alpn/alpn-boot-8.1.2.v20141202.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.2.v20141202.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_31.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_31.mod deleted file mode 100644 index 9ffca1a9699..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_31.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.3.v20150130|lib/alpn/alpn-boot-8.1.3.v20150130.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_40.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_40.mod deleted file mode 100644 index 9ffca1a9699..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_40.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.3.v20150130|lib/alpn/alpn-boot-8.1.3.v20150130.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_45.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_45.mod deleted file mode 100644 index 9ffca1a9699..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_45.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.3.v20150130|lib/alpn/alpn-boot-8.1.3.v20150130.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.3.v20150130.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_51.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_51.mod deleted file mode 100644 index bd6891a07e4..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_51.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.4.v20150727|lib/alpn/alpn-boot-8.1.4.v20150727.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.4.v20150727.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_60.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_60.mod deleted file mode 100644 index 004663c5e7a..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_60.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.5.v20150921|lib/alpn/alpn-boot-8.1.5.v20150921.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.5.v20150921.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_65.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_65.mod deleted file mode 100644 index 532c440dd42..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_65.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.6.v20151105|lib/alpn/alpn-boot-8.1.6.v20151105.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.6.v20151105.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_66.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_66.mod deleted file mode 100644 index 532c440dd42..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_66.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.6.v20151105|lib/alpn/alpn-boot-8.1.6.v20151105.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.6.v20151105.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_71.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_71.mod deleted file mode 100644 index 48de22c2231..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_71.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.7.v20160121|lib/alpn/alpn-boot-8.1.7.v20160121.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_72.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_72.mod deleted file mode 100644 index 48de22c2231..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_72.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.7.v20160121|lib/alpn/alpn-boot-8.1.7.v20160121.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_73.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_73.mod deleted file mode 100644 index 48de22c2231..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_73.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.7.v20160121|lib/alpn/alpn-boot-8.1.7.v20160121.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_74.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_74.mod deleted file mode 100644 index 48de22c2231..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_74.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.7.v20160121|lib/alpn/alpn-boot-8.1.7.v20160121.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_77.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_77.mod deleted file mode 100644 index 48de22c2231..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_77.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.7.v20160121|lib/alpn/alpn-boot-8.1.7.v20160121.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_91.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_91.mod deleted file mode 100644 index 48de22c2231..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_91.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.7.v20160121|lib/alpn/alpn-boot-8.1.7.v20160121.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.7.v20160121.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_92.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_92.mod deleted file mode 100644 index a3677be88e3..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-1.8.0_92.mod +++ /dev/null @@ -1,7 +0,0 @@ -DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[files] -maven://org.mortbay.jetty.alpn/alpn-boot/8.1.8.v20160420|lib/alpn/alpn-boot-8.1.8.v20160420.jar - -[exec] --Xbootclasspath/p:lib/alpn/alpn-boot-8.1.8.v20160420.jar diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-8.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-8.mod index 252d27466af..ece589b8884 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-8.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-8.mod @@ -1,33 +1,22 @@ DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html [description] -Provides ALPN support for JDK 8, modifying the sun.security.ssl -classes and adding them to the JVM boot classpath. -This modification has a tight dependency on specific recent updates of -Java 1.7 and Java 1.8 (Java versions prior to 1.7u40 are not supported). -This module will use an appropriate alpn-boot jar for your -specific version of Java. -# IMPORTANT: Versions of Java that exist after this module was created are -# not guaranteed to work with existing alpn-boot jars, and might -# need a new alpn-boot to be created / tested / deployed by the -# Jetty project in order to provide support for these future -# Java versions. -# -# All versions of the alpn-boot jar can be found at -# https://repo1.maven.org/maven2/org/mortbay/jetty/alpn/alpn-boot/ - -[depend] -alpn-impl/alpn-${java.version} - -[lib] -lib/jetty-alpn-openjdk8-server-${jetty.version}.jar +Provides ALPN support for JDK 8, using the Jetty ALPN Agent. [files] lib/ lib/alpn/ +maven://org.mortbay.jetty.alpn/jetty-alpn-agent/2.0.10|lib/alpn/jetty-alpn-agent-2.0.10.jar + +[lib] +lib/jetty-alpn-openjdk8-server-${jetty.version}.jar [license] -ALPN is a hosted at github under the GPL v2 with ClassPath Exception. -ALPN replaces/modifies OpenJDK classes in the sun.security.ssl package. +The ALPN implementation for Java 8u242 and earlier replaces/modifies OpenJDK classes +in the sun.security.ssl package. +These modified classes are hosted at GitHub under the GPL v2 with ClassPath Exception. http://github.com/jetty-project/jetty-alpn http://openjdk.java.net/legal/gplv2+ce.html + +[exec] +-javaagent:lib/alpn/jetty-alpn-agent-2.0.10.jar diff --git a/jetty-alpn/pom.xml b/jetty-alpn/pom.xml index d319192bdda..ea355904386 100644 --- a/jetty-alpn/pom.xml +++ b/jetty-alpn/pom.xml @@ -21,7 +21,7 @@ jdk9 - [1.9,) + [9,) jetty-alpn-java-client diff --git a/jetty-home/pom.xml b/jetty-home/pom.xml index 87910286041..7cc9e6cf16b 100644 --- a/jetty-home/pom.xml +++ b/jetty-home/pom.xml @@ -774,7 +774,7 @@ jdk9 - [1.9,) + [9,) diff --git a/jetty-http-spi/pom.xml b/jetty-http-spi/pom.xml index 319900b29ac..ec89e2470da 100644 --- a/jetty-http-spi/pom.xml +++ b/jetty-http-spi/pom.xml @@ -78,7 +78,7 @@ jdk9 - [1.9,) + [9,) diff --git a/jetty-http2/http2-alpn-tests/pom.xml b/jetty-http2/http2-alpn-tests/pom.xml index ce1c57e3afe..0eb37365467 100644 --- a/jetty-http2/http2-alpn-tests/pom.xml +++ b/jetty-http2/http2-alpn-tests/pom.xml @@ -20,7 +20,7 @@ maven-dependency-plugin - copy + copy-alpn-agent generate-resources copy @@ -29,8 +29,8 @@ org.mortbay.jetty.alpn - alpn-boot - ${alpn.version} + jetty-alpn-agent + ${alpn.agent.version} jar false ${project.build.directory}/alpn @@ -43,7 +43,7 @@ maven-surefire-plugin - -Xbootclasspath/p:${project.build.directory}/alpn/alpn-boot-${alpn.version}.jar + -javaagent:${project.build.directory}/alpn/jetty-alpn-agent-${alpn.agent.version}.jar=debug=true @@ -54,12 +54,6 @@ org.eclipse.jetty.alpn alpn-api ${alpn.api.version} - provided - - - org.eclipse.jetty - jetty-alpn-openjdk8-server - ${project.version} test @@ -68,6 +62,18 @@ ${project.version} test + + org.eclipse.jetty + jetty-alpn-server + ${project.version} + test + + + org.eclipse.jetty + jetty-alpn-openjdk8-server + ${project.version} + test + org.eclipse.jetty.http2 http2-server @@ -81,21 +87,4 @@ - - - jdk9 - - [1.9,) - - - - - org.eclipse.jetty - jetty-alpn-java-server - ${project.version} - test - - - - diff --git a/jetty-http2/http2-http-client-transport/pom.xml b/jetty-http2/http2-http-client-transport/pom.xml index 82f89728329..6381d1269ce 100644 --- a/jetty-http2/http2-http-client-transport/pom.xml +++ b/jetty-http2/http2-http-client-transport/pom.xml @@ -18,7 +18,7 @@ jdk8 - [1.8,1.9) + [1.8,9) @@ -26,7 +26,7 @@ maven-dependency-plugin - copy + copy-alpn-agent generate-resources copy @@ -35,8 +35,8 @@ org.mortbay.jetty.alpn - alpn-boot - ${alpn.version} + jetty-alpn-agent + ${alpn.agent.version} jar false ${project.build.directory}/alpn @@ -49,16 +49,29 @@ maven-surefire-plugin - -Xbootclasspath/p:${project.build.directory}/alpn/alpn-boot-${alpn.version}.jar + -javaagent:${project.build.directory}/alpn/jetty-alpn-agent-${alpn.agent.version}.jar=debug=true + + + org.eclipse.jetty.alpn + alpn-api + ${alpn.api.version} + provided + + + org.eclipse.jetty + jetty-alpn-openjdk8-client + ${project.version} + + jdk9 - [1.9,) + [9,) diff --git a/jetty-http2/pom.xml b/jetty-http2/pom.xml index e71440791fe..4139a840928 100644 --- a/jetty-http2/pom.xml +++ b/jetty-http2/pom.xml @@ -24,9 +24,10 @@ jdk8 - [1.8,1.9) + [1.8,9) + http2-alpn-tests diff --git a/jetty-maven-plugin/src/it/jetty-deploy-war-mojo-it/pom.xml b/jetty-maven-plugin/src/it/jetty-deploy-war-mojo-it/pom.xml index d29454fdaf9..95047929633 100644 --- a/jetty-maven-plugin/src/it/jetty-deploy-war-mojo-it/pom.xml +++ b/jetty-maven-plugin/src/it/jetty-deploy-war-mojo-it/pom.xml @@ -129,7 +129,7 @@ jdk9+ - [1.9,) + [9,) diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index 172062ee43d..600946d2241 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -17,7 +17,6 @@ 4.13.1 2.6.1 1.0 - true @@ -446,7 +445,6 @@ maven-surefire-plugin - ${skipTests} ${settings.localRepository} ${env.GLOBAL_MVN_SETTINGS} @@ -541,20 +539,17 @@ test - - false - maven-surefire-plugin + + + -Dmortbay-alpn-agent=${settings.localRepository}/org/mortbay/jetty/alpn/jetty-alpn-agent/${alpn.agent.version}/jetty-alpn-agent-${alpn.agent.version}.jar -Dconscrypt-version=${conscrypt.version} **/TestJettyOSGiBootHTTP2JDK9* - - - -Dmortbay-alpn-boot=${settings.localRepository}/org/mortbay/jetty/alpn/alpn-boot/${alpn.version}/alpn-boot-${alpn.version}.jar -Dconscrypt-version=${conscrypt.version} @@ -591,15 +586,11 @@ test - - false - maven-surefire-plugin - ${skipTests} **/TestJettyOSGiBootHTTP2 diff --git a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java index 0881197f951..1f971fd0e33 100644 --- a/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java +++ b/jetty-osgi/test-jetty-osgi/src/test/java/org/eclipse/jetty/osgi/test/TestJettyOSGiBootHTTP2.java @@ -47,7 +47,6 @@ import org.osgi.framework.ServiceReference; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.ops4j.pax.exam.CoreOptions.mavenBundle; import static org.ops4j.pax.exam.CoreOptions.systemProperty; @@ -93,18 +92,13 @@ public class TestJettyOSGiBootHTTP2 List - org.apache.maven.plugins maven-failsafe-plugin - -Xbootclasspath/p:${project.build.directory}/alpn/alpn-boot-${alpn.version}.jar + -javaagent:${project.build.directory}/alpn/jetty-alpn-agent-${alpn.agent.version}.jar=debug=true + + org.eclipse.jetty.alpn + alpn-api + ${alpn.api.version} + provided + org.eclipse.jetty jetty-alpn-openjdk8-client ${project.version} - - - org.eclipse.jetty.alpn - alpn-api - - org.eclipse.jetty @@ -120,7 +119,7 @@ jdk9 - [1.9,) + [9,) From 1be2f474243b9596915b464a9c921729811138c3 Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 18 Mar 2020 15:32:28 +0100 Subject: [PATCH 2/4] Issue #4443 - Track backport of ALPN APIs to Java 8. Improved logging after review. Signed-off-by: Simone Bordet --- .../alpn/openjdk8/client/OpenJDK8ClientALPNProcessor.java | 5 ++++- .../alpn/openjdk8/server/OpenJDK8ServerALPNProcessor.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/jetty-alpn/jetty-alpn-openjdk8-client/src/main/java/org/eclipse/jetty/alpn/openjdk8/client/OpenJDK8ClientALPNProcessor.java b/jetty-alpn/jetty-alpn-openjdk8-client/src/main/java/org/eclipse/jetty/alpn/openjdk8/client/OpenJDK8ClientALPNProcessor.java index 28557b64e45..440f02e6eb6 100644 --- a/jetty-alpn/jetty-alpn-openjdk8-client/src/main/java/org/eclipse/jetty/alpn/openjdk8/client/OpenJDK8ClientALPNProcessor.java +++ b/jetty-alpn/jetty-alpn-openjdk8-client/src/main/java/org/eclipse/jetty/alpn/openjdk8/client/OpenJDK8ClientALPNProcessor.java @@ -55,10 +55,13 @@ public class OpenJDK8ClientALPNProcessor implements ALPNProcessor.Client // Use reflection so we can build with a JDK version less than 8u252. alpnProtocols = SSLParameters.class.getMethod("setApplicationProtocols", String[].class); alpnProtocol = SSLEngine.class.getMethod("getApplicationProtocol"); + if (LOG.isDebugEnabled()) + LOG.debug("Using OpenJDK ALPN APIs instead of Jetty ALPN APIs"); return; } - catch (NoSuchMethodException ignored) + catch (NoSuchMethodException x) { + LOG.ignore(x); } // Backported ALPN APIs not available. diff --git a/jetty-alpn/jetty-alpn-openjdk8-server/src/main/java/org/eclipse/jetty/alpn/openjdk8/server/OpenJDK8ServerALPNProcessor.java b/jetty-alpn/jetty-alpn-openjdk8-server/src/main/java/org/eclipse/jetty/alpn/openjdk8/server/OpenJDK8ServerALPNProcessor.java index 552e98673d6..be39ef1ac66 100644 --- a/jetty-alpn/jetty-alpn-openjdk8-server/src/main/java/org/eclipse/jetty/alpn/openjdk8/server/OpenJDK8ServerALPNProcessor.java +++ b/jetty-alpn/jetty-alpn-openjdk8-server/src/main/java/org/eclipse/jetty/alpn/openjdk8/server/OpenJDK8ServerALPNProcessor.java @@ -52,10 +52,13 @@ public class OpenJDK8ServerALPNProcessor implements ALPNProcessor.Server // JDK 8u252 has the JDK 9 ALPN API backported. // Use reflection so we can build with a JDK version less than 8u252. alpnSelector = SSLEngine.class.getMethod("setHandshakeApplicationProtocolSelector", BiFunction.class); + if (LOG.isDebugEnabled()) + LOG.debug("Using OpenJDK ALPN APIs instead of Jetty ALPN APIs"); return; } - catch (NoSuchMethodException ignored) + catch (NoSuchMethodException x) { + LOG.ignore(x); } // Backported ALPN APIs not available. From 42c4d9b38a735996aa152132e414e41c60aebd6d Mon Sep 17 00:00:00 2001 From: Simone Bordet Date: Wed, 18 Mar 2020 16:41:02 +0100 Subject: [PATCH 3/4] Issue #4443 - Track backport of ALPN APIs to Java 8. Updated documentation. Signed-off-by: Simone Bordet --- .../asciidoc/administration/alpn/alpn.adoc | 84 +++++++++++++++---- 1 file changed, 68 insertions(+), 16 deletions(-) diff --git a/jetty-documentation/src/main/asciidoc/administration/alpn/alpn.adoc b/jetty-documentation/src/main/asciidoc/administration/alpn/alpn.adoc index 101dcb6c033..dc85090c54f 100644 --- a/jetty-documentation/src/main/asciidoc/administration/alpn/alpn.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/alpn/alpn.adoc @@ -33,20 +33,21 @@ When using Jetty as a standalone server via the Jetty distribution, the `jetty-a When using Jetty embedded, the `jetty-alpn-client` and `jetty-alpn-server` artifacts must be included in the classpath, respectively for client and server use cases. -The ALPN implementation is _provided_ to these two artifacts with the following three options: +The ALPN implementation is _provided_ to these two artifacts with the following options: -* For JDK 8 only, a provider based on modified OpenJDK classes -** Only works with JDK 8, pure Java implementation -** Requires the `-Xbootclasspath/p` option on command line -* For JDK 8 or later, a provider based on the link:#conscrypt[Conscrypt security provider] +* For Java 8 only, a provider based on a pure Java implementation (no native code) +** For Java 8 up to `1.8.0_242` included, this provider uses modified OpenJDK classes + and requires the `-Xbootclasspath/p:` option on command line +** For Java 8 from `1.8.0_252` included and later, this provider uses the standard OpenJDK + ALPN APIs introduced in Java 9 (see below) that have been backported to `1.8.0_252` and + does not require the `-Xbootclasspath/p:` option on command line +* For Java 8 or later, a provider based on the link:#conscrypt[Conscrypt security provider] ** Works with JDK 8 or later and provides improved performance ** Binds to the OpenSSL native library shipped by Conscrypt and is therefore only available on the platforms supported by Conscrypt -* For JDK 9 or later, a provider based on the ALPN APIs present in the JDK -** Works with JDK 9 or later, pure Java implementation +* For Java 9 or later, a provider based on the standard OpenJDK ALPN APIs +** Works with JDK 9 or later, pure Java implementation (no native code) ** Lower performance than Conscrypt -The first, although hosted under the umbrella of the Jetty project, is independent of Jetty (the Servlet Container); you can use it in any other Java network server. - Each provider above provides an ALPN _service_ implementation; Jetty uses the `ServiceLoader` mechanism to load these service implementations. At least one valid provider must be present in the server classpath. For example, using JDK 8 with the JDK 9 ALPN provider is an _invalid_ combination. @@ -60,7 +61,18 @@ It is therefore possible to have multiple providers active at the same time, for [[alpn-openjdk8]] ==== ALPN and OpenJDK 8 -When using JDKs based on OpenJDK 8 (for JDK 9 see link:#alpn-jdk9[above]), and you do not or cannot use link:#conscrypt[Conscrypt], you can use Jetty's ALPN boot library to provide the ALPN service implementation, via the `alpn-boot` artifact. +When using JDKs based on OpenJDK 8 (for JDK 9 see link:#alpn-jdk9[here]), and you do not or +cannot use link:#conscrypt[Conscrypt], the ALPN implementation is provided by the +`jetty-alpn-openjdk8-client` or `jetty-alpn-openjdk8-server` artifacts. + +For Java 8 versions up to `1.8.0_242` included, you also need the Jetty's ALPN boot library +to provide the ALPN service implementation, via the `alpn-boot` artifact. +For Java 8 versions from `1.8.0_252` included and later, Jetty's ALPN boot library is not +necessary because the OpenJDK ALPN APIs have been backported to `1.8.0_252` and the +`jetty-alpn-openjdk8-*` artifacts can use these backported APIs if their presence is detected. + +Alternatively, you can use the link:#alpn-openjdk8-agent[Jetty ALPN agent], that in turn uses +theJetty ALPN boot library to transform the relevant OpenJDK classes when they are loaded. The Jetty ALPN boot library modifies the relevant OpenJDK classes to add ALPN support and provides an ALPN API that application can use to enable ALPN. @@ -69,13 +81,14 @@ This enables transitively the `alpn-8` module which puts the `jetty-alpn-openjdk When using Jetty embedded, the ALPN support is provided by the `jetty-alpn-openjdk8-client` and `jetty-alpn-openjdk8-server` artifacts, respectively for client usage and server usage. -To get ALPN working with the Jetty ALPN Boot library, you need: +To get ALPN working with Java 8, you must have the `jetty-alpn-openjdk8-client` artifact or +the `jetty-alpn-openjdk8-server` artifact in the classpath. -* to start the JVM with the Jetty ALPN Boot library in the boot classpath -* to have the `jetty-alpn-openjdk8-client` artifact or the `jetty-alpn-openjdk8-server` -artifact in the classpath +Additionally, if you are using OpenJDK `1.8.0_242` or earlier, you need the Jetty ALPN boot +library (corresponding to the exact OpenJDK version you are using) in the boot classpath, +or alternatively you need the link:#alpn-openjdk8-agent[Jetty ALPN agent]. -Start the JVM as follows: +In the case of the Jetty ALPN boot library, start the JVM as follows: [source, plain, subs="{sub-order}"] ---- @@ -84,7 +97,45 @@ java -Xbootclasspath/p: ... Where `path_to_alpn_boot_jar` is the path on the file system for the `alpn-boot` artifact, such as the one at the Maven coordinates `org.mortbay.jetty.alpn:alpn-boot`. -Be certain to get the link:#alpn-versions[ALPN boot artifact version that matches the version of your JRE]. +____ +[IMPORTANT] +Be certain to get the +link:#alpn-versions[ALPN boot artifact version that matches the version of your JRE]. +____ + +[[alpn-openjdk8-agent]] +==== ALPN agent and OpenJDK 8 + +The Jetty Project also maintains the +https://github.com/jetty-project/jetty-alpn-agent[Jetty ALPN agent], which is a JVM +agent that provides the ALPN implementation. +The Jetty ALPN agent can be use in alternative (never together) with the +link:#alpn-openjdk8[ALPN boot library]. + +The Jetty ALPN agent contains the ALPN boot libraries for every JDK 8 version. +The agent can be used only with Java 8, but works with _any_ Java 8 version. + +The Jetty ALPN agent detects the JDK version currently running, picks the correspondent +ALPN boot library (or picks none if the JDK version is `1.8.0_252` or later), and +transforms, if necessary, the relevant OpenJDK classes to provide the ALPN support. + +To use the Jetty ALPN agent, start the JVM as follows: + +[source, plain, subs="{sub-order}"] +---- +java -javaagent: ... +---- + +____ +[NOTE] +The Jetty ALPN agent works with any Java 8 version. It is _required_ if you use +an OpenJDK version up to `1.8.0_242` included, and it is _optional_ if you use an +OpenJDK version equal or greater than `1.8.0_252`. + +The Jetty ALPN agent can be left on the command line even when using an OpenJDK version +equal or greater than `1.8.0_252` but we recommend to remove it from the command line +when you use OpenJDK `1.8.0_252` or later. +____ [[alpn-conscrypt]] ==== ALPN and Conscrypt @@ -359,6 +410,7 @@ The ALPN implementation, relying on modifications of OpenJDK classes, updates ev |1.8.0u232 |8.1.13.v20181017 |1.8.0u241^[1]^ |8.1.13.v20181017 |1.8.0u242 |8.1.13.v20181017 +|1.8.0u252 and later | NOT NECESSARY |============================= ^[1]^ These are Oracle releases for which the source code is not available, or it is unclear what exactly is because there is no correspondent tag in From 0541c5efb451b1e7fc40cdf217abfa4d0f6457e5 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 19 Mar 2020 07:06:13 +1000 Subject: [PATCH 4/4] fix javadoc aggregate generation by using last maven javadoc plugin 3.2.0 (#4675) Signed-off-by: olivier lamy --- Jenkinsfile | 2 +- build-resources/pom.xml | 12 ++++++++++++ jetty-osgi/test-jetty-osgi-context/pom.xml | 13 ++++++++++++- jetty-osgi/test-jetty-osgi-fragment/pom.xml | 13 ++++++++++++- jetty-osgi/test-jetty-osgi-server/pom.xml | 12 ++++++++++++ jetty-osgi/test-jetty-osgi-webapp/pom.xml | 13 ++++++++++++- jetty-osgi/test-jetty-osgi/pom.xml | 8 ++++++++ jetty-websocket/websocket-javax-tests/pom.xml | 8 ++++++++ jetty-websocket/websocket-jetty-tests/pom.xml | 12 ++++++++++++ pom.xml | 3 ++- scripts/release-jetty.sh | 2 +- 11 files changed, 92 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 11a770057d3..4477293c51e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -55,7 +55,7 @@ pipeline { agent { node { label 'linux' } } steps { timeout(time: 30, unit: 'MINUTES') { - mavenBuild("jdk11", "install javadoc:javadoc -DskipTests -Dpmd.skip=true -Dcheckstyle.skip=true", "maven3", true) + mavenBuild("jdk11", "package source:jar javadoc:jar javadoc:aggregate-jar -Peclipse-release -DskipTests -Dpmd.skip=true -Dcheckstyle.skip=true", "maven3", true) warnings consoleParsers: [[parserName: 'Maven'], [parserName: 'JavaDoc'], [parserName: 'Java']] } } diff --git a/build-resources/pom.xml b/build-resources/pom.xml index 9d943840c28..89f78175b64 100644 --- a/build-resources/pom.xml +++ b/build-resources/pom.xml @@ -20,6 +20,18 @@ META-INF + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + true + + + + org.apache.maven.plugins diff --git a/jetty-osgi/test-jetty-osgi-context/pom.xml b/jetty-osgi/test-jetty-osgi-context/pom.xml index 9deafe864a6..49ce22029ee 100644 --- a/jetty-osgi/test-jetty-osgi-context/pom.xml +++ b/jetty-osgi/test-jetty-osgi-context/pom.xml @@ -39,7 +39,18 @@ src/main/context - + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + true + + + + org.apache.maven.plugins diff --git a/jetty-osgi/test-jetty-osgi-fragment/pom.xml b/jetty-osgi/test-jetty-osgi-fragment/pom.xml index e43a76e22a4..e3b7af48eef 100644 --- a/jetty-osgi/test-jetty-osgi-fragment/pom.xml +++ b/jetty-osgi/test-jetty-osgi-fragment/pom.xml @@ -19,7 +19,18 @@ src/main/resources - + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + true + + + + org.apache.maven.plugins diff --git a/jetty-osgi/test-jetty-osgi-server/pom.xml b/jetty-osgi/test-jetty-osgi-server/pom.xml index a213793c34f..ccf17f5a981 100644 --- a/jetty-osgi/test-jetty-osgi-server/pom.xml +++ b/jetty-osgi/test-jetty-osgi-server/pom.xml @@ -31,6 +31,18 @@ + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + true + + + + org.apache.maven.plugins diff --git a/jetty-osgi/test-jetty-osgi-webapp/pom.xml b/jetty-osgi/test-jetty-osgi-webapp/pom.xml index cb9ff9bc9a6..757dd7f09e9 100644 --- a/jetty-osgi/test-jetty-osgi-webapp/pom.xml +++ b/jetty-osgi/test-jetty-osgi-webapp/pom.xml @@ -36,7 +36,18 @@ src/main/resources - + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + true + + + + org.apache.maven.plugins diff --git a/jetty-osgi/test-jetty-osgi/pom.xml b/jetty-osgi/test-jetty-osgi/pom.xml index 0c13244b308..d82c7e2dde9 100644 --- a/jetty-osgi/test-jetty-osgi/pom.xml +++ b/jetty-osgi/test-jetty-osgi/pom.xml @@ -477,6 +477,14 @@ + + org.apache.maven.plugins + maven-javadoc-plugin + + + true + + maven-surefire-plugin diff --git a/jetty-websocket/websocket-javax-tests/pom.xml b/jetty-websocket/websocket-javax-tests/pom.xml index 9fc1fac0bdd..23ced0fc942 100644 --- a/jetty-websocket/websocket-javax-tests/pom.xml +++ b/jetty-websocket/websocket-javax-tests/pom.xml @@ -51,6 +51,14 @@ + + org.apache.maven.plugins + maven-javadoc-plugin + + + true + + org.apache.felix maven-bundle-plugin diff --git a/jetty-websocket/websocket-jetty-tests/pom.xml b/jetty-websocket/websocket-jetty-tests/pom.xml index 6c935a89e7a..7c3588d6562 100644 --- a/jetty-websocket/websocket-jetty-tests/pom.xml +++ b/jetty-websocket/websocket-jetty-tests/pom.xml @@ -73,6 +73,18 @@ + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + true + + + + org.apache.felix diff --git a/pom.xml b/pom.xml index 74286af9022..122243794fb 100644 --- a/pom.xml +++ b/pom.xml @@ -559,7 +559,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.1.1 + 3.2.0 true true @@ -576,6 +576,7 @@ true true com.*:org.slf4j*:org.mortbay*:*.jmh*:org.eclipse.jetty.embedded*:org.eclipse.jetty.example.asyncrest*:org.eclipse.jetty.test* + apache-jstl,jetty-osgi-alpn,infinispan-common,infinispan-embedded,infinispan-embedded-query,infinispan-remote,infinispan-remote-query,jetty-plus,jetty-jndi,jetty-documentation,jetty-distribution,jetty-home,jetty-bom,jetty-all,jetty-runner diff --git a/scripts/release-jetty.sh b/scripts/release-jetty.sh index ae0cb0d2f67..408a639c68b 100755 --- a/scripts/release-jetty.sh +++ b/scripts/release-jetty.sh @@ -167,7 +167,7 @@ if proceedyn "Are you sure you want to release using above? (y/N)" n; then # This is equivalent to 'mvn release:perform' if proceedyn "Build/Deploy from tag $TAG_NAME? (Y/n)" y; then git checkout $TAG_NAME - mvn clean package source:jar javadoc:jar gpg:sign deploy \ + mvn clean package source:jar javadoc:jar gpg:sign javadoc:aggregate-jar deploy \ -Peclipse-release $DEPLOY_OPTS reportMavenTestFailures git checkout $GIT_BRANCH_ID