With Jetty 11 I was able to get info about SSL session and client certificate by:
SSLSession sslSession = (SSLSession)request.getAttribute("org.eclipse.jetty.servlet.request.ssl_session");
java.security.cert.X509Certificate client_certs[] = (java.security.cert.X509Certificate[])request.getAttribute("jakarta.servlet.request.X509Certificate");
But with Jetty 12 I see only two request attributes:
org.eclipse.jetty.server.Request.Cookiesorg.eclipse.jetty.server.x509with server certificate
I am interested in attributes like:
ssl_protocol=TLSv1.3ssl_cipher=TLS_CHACHA20_POLY1305_SHA256ssl_client_i_dn=CN=xyzx_ssl_client_cert=-----BEGIN CERTIFICATE----- MIID8DCCAtigAwIBAgICA3wwDQYJKoZIhvcNAQELBQAwdzELMAkGA1UEBhMCUEwx ...
How can I get those attributes with Jetty 12?
The
ForwardedRequestCustomizerandSecureRequestCustomizerdoes the work of pulling the information out and making it available via the Request object.Eg:
The
Requestobject will be populated with the details you are looking for.Alternatively, you can pull it out of the jetty-core
Requestobject.