-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mTLS: client cert verification for QUIC/HTTP3 #11996
Comments
Regarding As for Do you have a reproducer which shows needClientAuth being ignored? |
Thank you for the fast response. I'll re-verify my code and create a minimal example to reproduce the issue with peer verification. |
I added some debug logging to Testing with
My code base is in clojure and I'm having trouble creating a standalone java example to reproduce. Hopefully I can get some guidance on debugging this further. Thank you. |
Looking at the Quiche doc of verify_peer, it looks like there is no way to force it to mandate a client certificate; quoting: Note that on the server-side, enabling verification of the peer will trigger a certificate request and make authentication errors fatal, but will still allow anonymous clients (i.e. clients that don’t present a certificate at all). Servers can check whether a client presented a certificate by calling peer_cert() if they need to. So the recommended action from Quiche's doc translated to Jetty would be to use a I'm wondering if there is something Jetty could do internally to close connections that do not present a certificate after Quiche successfully created them. |
Thank you. I've tested with 2.0.11-SNAPSHOT and the As a general question, is there a way for a handler to force a close on a client connection ? |
No, you cannot force the server to close a connection. You'd have to respond with some HTTP error status in the 400-500 ranges in this case. |
Signed-off-by: Ludovic Orban <[email protected]>
…entAuth is true (#12014) #11996 deny connection creation for clients missing needed cert Signed-off-by: Ludovic Orban <[email protected]>
Thank you. Tested the |
Thanks for the feedback! |
Jetty version(s)
12.0.10
Jetty Environment
core
Java version/vendor
(use: java -version)
openjdk version "21.0.3" 2024-04-16
OpenJDK Runtime Environment Homebrew (build 21.0.3)
OpenJDK 64-Bit Server VM Homebrew (build 21.0.3, mixed mode, sharing)
OS type/version
Darwin ... 23.5.0 Darwin Kernel Version 23.5.0 arm64
and
Linux ... 6.5.0-41-generic 22.04.2-Ubuntu x86_64
Description
I'm using
SslContextFactory.Server
to configure the context which is used for HTTP 1.1, HTTP 2 and HTTP3. I have setsetNeedClientAuth
totrue
.In the case of HTTP 1.1 and HTTP2, the server demands the client certificate and verifies it against the configured trust store before the connection can proceed
HTTP3 does not demand the certificate and allows connection without the client certificate.
It appears that Quiche provides a
verify_peer
option and there is a low level test for it in the code base https://github.com/jetty/jetty.project/blob/jetty-12.0.x/jetty-core/jetty-quic/jetty-quic-quiche/jetty-quic-quiche-foreign/src/test/java/org/eclipse/jetty/quic/quiche/foreign/LowLevelQuicheClientCertTest.java#L100I believe the underlying
verifyPeer
value should be set based on the value ofgetNeedClientAuth
on theSslContextFactory.Server
.Additionally there should be a way to add the
SecureRequestCustomizer
or equivalent so that the handlers can access the client cert for the QUIC/HTTP3 connection.How to reproduce?
Use an
SslContextFactory.Server
withsetNeedClientAuth(true)
with the example at https://jetty.org/docs/jetty/12/programming-guide/server/http3.htmlThe text was updated successfully, but these errors were encountered: