You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OS type/version
openjdk version "21.0.1" 2023-10-17 LTS
OpenJDK Runtime Environment Zulu21.30+15-CA (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Zulu21.30+15-CA (build 21.0.1+12-LTS, mixed mode, sharing)
Description
I am getting the following internal exception:
class org.eclipse.jetty.io.SocketChannelEndPoint cannot be cast to class org.eclipse.jetty.quic.common.QuicStreamEndPoint (org.eclipse.jetty.io.SocketChannelEndPoint is in module org.eclipse.jetty.io@12.0.3 of loader 'app'; org.eclipse.jetty.quic.common.QuicStreamEndPoint is in module org.eclipse.jetty.quic.common@12.0.3 of loader 'app')
at org.eclipse.jetty.http3.client@12.0.3/org.eclipse.jetty.http3.client.HTTP3ClientConnectionFactory.newConnection(HTTP3ClientConnectionFactory.java:56)
at org.eclipse.jetty.http3.client.transport@12.0.3/org.eclipse.jetty.http3.client.transport.ClientConnectionFactoryOverHTTP3.newConnection(ClientConnectionFactoryOverHTTP3.java:44)
at org.eclipse.jetty.client@12.0.3/org.eclipse.jetty.client.transport.HttpClientTransportDynamic.newConnection(HttpClientTransportDynamic.java:210)
at org.eclipse.jetty.io@12.0.3/org.eclipse.jetty.io.ClientConnector$Configurator.newConnection(ClientConnector.java:647)
at org.eclipse.jetty.io@12.0.3/org.eclipse.jetty.io.ClientConnector.newConnection(ClientConnector.java:531)
at org.eclipse.jetty.io@12.0.3/org.eclipse.jetty.io.ClientConnector$ClientSelectorManager.newConnection(ClientConnector.java:563)
at org.eclipse.jetty.io@12.0.3/org.eclipse.jetty.io.ManagedSelector.createEndPoint(ManagedSelector.java:385)
at org.eclipse.jetty.io@12.0.3/org.eclipse.jetty.io.ManagedSelector$CreateEndPoint.run(ManagedSelector.java:1080)
at org.eclipse.jetty.util@12.0.3/org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:971)
at org.eclipse.jetty.util@12.0.3/org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.doRunJob(QueuedThreadPool.java:1196)
at org.eclipse.jetty.util@12.0.3/org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1151)
How to reproduce?
I am constructing HttpClient using the following code:
SslContextFactory.Client sslContextFactory = new SslContextFactory.Client();
// the server is running on localhost using a self-signed certificate
sslContextFactory.setTrustAll(true);
sslContextFactory.setHostnameVerifier((hostName, _) -> hostName.endsWith("localhost"));
ClientConnector clientConnector = new ClientConnector();
clientConnector.setSslContextFactory(sslContextFactory);
ClientConnectionFactory.Info http11 = HttpClientConnectionFactory.HTTP11;
HTTP2Client http2Client = new HTTP2Client(clientConnector);
ClientConnectionFactory.Info http2 = new ClientConnectionFactoryOverHTTP2.HTTP2(http2Client);
HTTP3Client http3Client = new HTTP3Client();
ClientConnectionFactory.Info http3 = new ClientConnectionFactoryOverHTTP3.HTTP3(http3Client);
// The client's preferences from most to least preferable protocol
HttpClientTransport transport = new HttpClientTransportDynamic(clientConnector, http3, http2, http11);
HttpClient client = new HttpClient(transport);
client.setExecutor(scope.getClientExecutor());
long clientTimeout = scope.getClientTimeout().toMillis();
client.setConnectTimeout(clientTimeout);
client.setIdleTimeout(clientTimeout);
Before I added HTTP/2 and HTTP/3 support, I did not get this exception.
It feels like this is caused by a configuration error, though I'd argue that Jetty should catch this error at configuration time instead of much later on at runtime... What am I doing wrong? If this is a bug, is there a workaround?
The text was updated successfully, but these errors were encountered:
ClientConnectionFactory.Info http11 = HttpClientConnectionFactory.HTTP11;
HTTP2Client http2Client = new HTTP2Client();
http2Client.getClientConnector().setSslContextFactory(sslContextFactory);
ClientConnectionFactory.Info http2 = new ClientConnectionFactoryOverHTTP2.HTTP2(http2Client);
HTTP3Client http3Client = new HTTP3Client();
http3Client.getClientConnector().setSslContextFactory(sslContextFactory);
ClientConnectionFactory.Info http3 = new ClientConnectionFactoryOverHTTP3.HTTP3(http3Client);
HttpClientTransport transport = new HttpClientTransportDynamic(http3, http2, http11);
Meaning, instead of creating my own ClientConnector I let each client create its own, then I set the SslContextFactory in it. Also, I removed the ClientConnector argument passed into HttpClientTransportDynamic.
General feedback:
It would be good to provide a "kitchen-sink" example in form of a unit test and/or in the documentation where both the client and server have all the protocols, proxy, ALPN, etc. support enabled.
The original code I posted above should throw an exception at configuration-time instead of when a request is sent.
Jetty version(s)
12.0.3
Java version/vendor
(use: java -version)
OS type/version
openjdk version "21.0.1" 2023-10-17 LTS
OpenJDK Runtime Environment Zulu21.30+15-CA (build 21.0.1+12-LTS)
OpenJDK 64-Bit Server VM Zulu21.30+15-CA (build 21.0.1+12-LTS, mixed mode, sharing)
Description
I am getting the following internal exception:
How to reproduce?
I am constructing
HttpClient
using the following code:Before I added HTTP/2 and HTTP/3 support, I did not get this exception.
It feels like this is caused by a configuration error, though I'd argue that Jetty should catch this error at configuration time instead of much later on at runtime... What am I doing wrong? If this is a bug, is there a workaround?
The text was updated successfully, but these errors were encountered: