Search code examples
jettymutual-authentication

Is it possible to run a Jetty server with a single connector using two ports, one that uses mutual authentication and another that does not?


I am trying to design a Jetty instance that accepts incoming requests in two forms: 1. Mutual authentication 2. Non-mutual authentication

Is this possible to do using a single connector with two ports?

Thanks!


Solution

  • By design, a ServerConnector is bound to 1 and only 1 port.

    If you need 2 separate ports, then you'll need 2 separate ServerConnector configurations.

    And based on your question, you'll need different SslContextFactory configurations for each connector.