Is it possible to change keystore at runtime? Currently I am setting up SSL before I do a server.start() -
sslContextFactory.setTrustStore(ks);
sslContextFactor
Create your own KeyStore
implementation.
You can create a class that overrides KeyStore
and put this as a truststore to Jetty. Then you are free to return any Certificate
you want.
Probably you have to use a 3rd party library to create certificates on the fly as Java cannot create certificates (with the official API). You can use BouncyCastle for this.