I need to access the HttpServletRequest
properties to get the javax.servlet.request.X509Certificate which contains the X509Certificate
array of certificates for TLS requests.
From a JAX-RS ContainerRequestFilter
I can easily extract this from the ContainerRequestContext.getProperty(String property)
method, but I can't find a way to get it from the WebSocket Session
nor the HandshakeRequest
, from which I can access the HttpSession
instance but not the HttpServletRequest
one.
Note: this is not a duplicate of Accessing HttpSession from HttpServletRequest in a Web Socket @ServerEndpoint since I need accesso to the HttpServletRequest
(or equivalent to extract the TLS certificates), not HttpSession
.
Since WebSocket is a superset of HTTP, I guess it should be possibile and hope the Java team had thought of a way to access the servlet properties, but I really couldn't find one. Anyone knows if this is possible at all?