setting ssl keystore at runtime in Jetty

前端 未结 5 1542
盖世英雄少女心
盖世英雄少女心 2021-02-13 14:47

Is it possible to change keystore at runtime? Currently I am setting up SSL before I do a server.start() -

sslContextFactory.setTrustStore(ks);
sslContextFactor         


        
5条回答
  •  庸人自扰
    2021-02-13 15:32

    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.

提交回复
热议问题