Comments (8)
You need to include the dependency for jetty-alpn-java-[client|server]
only when using JDK 9.
This is easily done with a Maven profile.
The jar cannot be built with JDK 8 because it uses JDK 9 specific APIs.
from jetty-alpn.
from jetty-alpn.
Typically we have used either the jetty start.jar modules or Maven profiles to assemble the correct jars.
Unfortunately we can't make this jar a Multi release jar because it users the service loader which cannot be version Ed. Perhaps we can put a dummy java 8 version in the jar that is a noop. I've reopened to consider this.
Also you can now use conscript for ssl which has the same alpn for Java 8 and java 9.
from jetty-alpn.
Right Maven profile can be used but only if you directly use Jetty library not if you are building a library that uses Jetty.
What about using a condition just like the NegotiatingServerConnectionFactory
class (see https://github.com/eclipse/jetty.project/blob/jetty-9.4.x-1200/jetty-server/src/main/java/org/eclipse/jetty/server/NegotiatingServerConnectionFactory.java#L41) to determine the JVM version and use the service loader only when it is Java 9?
from jetty-alpn.
I managed to find a workaround but I don't think it is a recommended way.
Using Jetty 9.4.8, with the following dependencies (in this order I suppose) and build with Java 9. I just have to add alpn-boot (-Xbootclasspath/p:/path/to/alpn-boot.jar) for running with Java 8 and the modules for Java 9 (--add-modules java.activation,java.xml.bind
).
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-java-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-java-client</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-openjdk8-server</artifactId>
<version>${jetty.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-alpn-openjdk8-client</artifactId>
<version>${jetty.version}</version>
</dependency>
from jetty-alpn.
Yes this is the correct way.
Artifacts jetty-alpn-java-[client|server]
are built by Jetty with target JDK 9, while artifacts jetty-alpn-openjdk8-[client|server]
are built with target JDK 8.
A library may ship all artifacts, and Jetty will use the ServiceLoader
to load the right implementation at runtime, preferring jetty-alpn-openjdk8-*
when the runtime is JDK 8 and jetty-alpn-java-*
when the runtime is JDK 9.
Unfortunately you still need the bootclasspath for JDK 8 only, so it's not a completely transparent solution, as you have to change the command line depending on the JDK version.
from jetty-alpn.
Note that you may wish to consider using the conscrypt SSL provider with jetty. Not only is it much faster than native SSL, but it supports ALPN in both java8 and java9 without the need to modify the boot path.
https://www.eclipse.org/jetty/documentation/9.4.x/jetty-ssl-distribution.html
Documentation has also been updated for the next release: jetty/jetty.project@904acea
from jetty-alpn.
no more warning, after I excluded JDK 9 version Alpn in Gradle
configurations.forEach {
it.exclude("org.eclipse.jetty", "jetty-alpn-java-server")
it.exclude("org.eclipse.jetty", "jetty-alpn-server")
}
from jetty-alpn.
Related Issues (20)
- License of Project HOT 7
- Compile error with Oracle JDK 8u121 HOT 3
- 1.8.0_131 support HOT 5
- Introduce a jdk-to-alpn version mapping file
- Can it be used with tomcat? HOT 1
- SSLProtocolException: Handshake message sequence violation, 1 HOT 6
- Error when concurrent call during TLS initialization HOT 5
- alpn-api vulnerability HOT 3
- How to fail handshake due to no compatible protocols
- Support JDK 8u191 / 8u192 HOT 1
- OpenJDK 1.8.0_181 b13 support HOT 13
- Possible version incompatibility HOT 1
- Unexpected http request response HOT 6
- ALPN update for JDK8u242 HOT 1
- Jetty-alpn 8.1.13 is incompatible with the latest jdk8u252-ga build HOT 1
- jetty-alpn incompatible with OpenJDK 8u251 HOT 8
- version info for java 1.7.71 and 1.7.72 HOT 4
- selected() not run for cached sessions HOT 14
- ALPN API should allow throwing IOException or SSLException HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jetty-alpn.