javamavenjettydropwizardembedded-jetty

Jetty and Dropwizard: KeyStores with multiple certificates are not supported on the base class org.eclipse.jetty.util.ssl.SslContextFactory


I am running into the follow error while upgrading my versions of Jetty for a Dropwizard project:

java.lang.IllegalStateException: KeyStores with multiple certificates are not supported on the base class org.eclipse.jetty.util.ssl.SslContextFactory. (Use org.eclipse.jetty.util.ssl.SslContextFactory$Server or org.eclipse.jetty.util.ssl.SslContextFactory$Client instead)

The tricky part is that I do not directly set up my SslContextFactory in code. Instead, Dropwizard sets it up behind the scenes at application startup, where it quickly runs into this issue and fails.

I see from the Dropwizard documentation that certain environment variables can be set on the Jetty server that it spins up, but I do not see documentation on how to modify specific classes.

If I add a jetty.xml file within $JETTY_HOME$/etc/config, will Dropwizard know how to pick this up?

I just need to understand how Dropwizard picks up settings on Jetty so I can use SslContextFactory.Server and resolve this error at startup.


Solution

  • Your version of Dropwizard is too old.

    Dropwizard properly uses the SslContextFactory.Server where appropriate.