From 28b0128500ff7d84879f3a8c99d683c2d171411c Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Tue, 14 Dec 2021 12:50:31 +1100 Subject: [PATCH] Issue #7266 - preserve old runtime.feature.alpn property Signed-off-by: Lachlan Roberts --- .../src/main/config/modules/alpn-impl/alpn-16.mod | 4 ---- jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn.mod | 2 +- .../src/main/java/org/eclipse/jetty/start/StartArgs.java | 3 ++- 3 files changed, 3 insertions(+), 6 deletions(-) delete mode 100644 jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-16.mod diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-16.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-16.mod deleted file mode 100644 index 4dbcf25f583..00000000000 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn-impl/alpn-16.mod +++ /dev/null @@ -1,4 +0,0 @@ -# DO NOT EDIT - See: https://www.eclipse.org/jetty/documentation/current/startup-modules.html - -[depend] -alpn-impl/alpn-11 diff --git a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn.mod b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn.mod index bd99ae571c2..2af032a28fc 100644 --- a/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn.mod +++ b/jetty-alpn/jetty-alpn-server/src/main/config/modules/alpn.mod @@ -5,7 +5,7 @@ Enables the ALPN (Application Layer Protocol Negotiation) TLS extension. [depend] ssl -alpn-impl/alpn-available-${runtime.feature.alpn} +alpn-impl/alpn-available-${at.least.java9} [lib] lib/jetty-alpn-client-${jetty.version}.jar diff --git a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java index c36c130d80a..21c020f4564 100644 --- a/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java +++ b/jetty-start/src/main/java/org/eclipse/jetty/start/StartArgs.java @@ -1502,7 +1502,8 @@ public class StartArgs properties.setProperty("java.version.micro", Integer.toString(ver.getMicro()), "Deprecated"); // ALPN feature exists - properties.setProperty("runtime.feature.alpn", Boolean.toString(ver.getPlatform() >= 9), source); + properties.setProperty("runtime.feature.alpn", Boolean.toString(isMethodAvailable(javax.net.ssl.SSLParameters.class, "getApplicationProtocols", null)), source); + properties.setProperty("at.least.java9", Boolean.toString(ver.getPlatform() >= 9), source); } catch (Throwable x) {