Jetty - Dynamic MTLS

Viewed 140

I was curious if anyone knew how to implement a Dynamic MTLS solution in Jetty? We have a use case where we need to do device authentication. We want each device to have a different client certificate for security reasons. Is there a way to dynamically pull and validate the server certificate with the one the client sent in? I was combing through the SslContextFactory and ServerConnector java classes, but could not quite figure out which method to override if I extended them. Any help would be greatly appreciated.

2 Answers

The canonical way would be for each device to have a certificate D signed with a server certificate SS.

Note that the server's signing certificate SS may be different (and typically is) from the server's domain certificate.

The server (or a similar authority that you control) emits signed certificates for new devices (a certificate Dn signed with SS). Basically the server acts as a standard Certificate Authority.

Certificate SS need not to be signed by another authority, as long as it's trusted by the server (i.e. it's in the server TrustStore).

There is no need to extend any Jetty class, just use the standard PKI processes and tools, and then the only thing you need to do is to configure Jetty accordingly.

I would recommend deploying your own PKI and have server and devices certificated issued by your own authority. Simone's answer on using server certificate to sign clients will stop working if you change server certificate and you do not want server certificate with long validity.

Related