websocket
websocket copied to clipboard
Method to access SSL certificates at handshake
When a WS connection is established through a secure TLS connection, it would be useful to get info about the certificates used. In a JAX-RS ContainerRequestFilter I'm used to get this information using:
@Priority(Priorities.AUTHENTICATION)
public class AuthenticationFilter implements ContainerRequestFilter {
@Override
public void filter(ContainerRequestContext containerRequestContext) throws IOException {
X509Certificate[] certificates = (X509Certificate[]) containerRequestContext.getProperty("javax.servlet.request.X509Certificate");
// process authentication based on certificates
}
}
I tried to use a similar approach in a custom ServerEndpointConfig.Configurator, looking for the same information in the HandshakeRequest, but I couldn't find a way to get it.
- Issue Imported From: https://github.com/javaee/websocket-spec/issues/242
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @pavelbucek
@glassfishrobot Commented Reported by heruan
@glassfishrobot Commented This issue was imported from java.net JIRA WEBSOCKET_SPEC-242
See also #255 and #218