Certificate creation at runtime is non-trivial. There also exists no API or library for such a task. (unless you consider using Runtime.exec or ProcessBuilder to call system tools an API) Also know that once the SslContextFactory is created and started, it cannot change.
But if you want to try, you'll want to configure SslContextFactory<http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/util/ssl/SslContextFactory.html>in jetty before you start the jetty server. (once the server is started, you cannot change the SslContextFactory, the underlying TrustManager, or the underlying KeyStore) When you create the the SslContextFactory, you can provide<http://download.eclipse.org/jetty/stable-9/apidocs/org/eclipse/jetty/util/ssl/SslContextFactory.html#setKeyStore(java.security.KeyStore)>your own KeyStore<http://docs.oracle.com/javase/7/docs/api/java/security/KeyStore.html>, but managing that KeyStore is out of scope for jetty, see your Java documentation for that. Know however, that much of the SSL layer expects content from a filesystem somewhere, so you'll want to get intimately familiar with SslContextFactory<https://github.com/eclipse/jetty.project/blob/master/jetty-util/src/main/java/org/eclipse/jetty/util/ssl/SslContextFactory.java>and understand its needs as well. Best of luck, -- Joakim Erdfelt <[email protected]> webtide.com <http://www.webtide.com/> Developer advice, services and support from the Jetty & CometD experts eclipse.org/jetty - cometd.org On Thu, Jun 20, 2013 at 10:30 AM, Gaurav Kumar <[email protected]>wrote: > I asked this question on SO but haven't got correct answer- > > http://stackoverflow.com/questions/16706333/setting-ssl-keystore-at-runtime-in-jetty > > I am hoping someone on this list can help. > > Basically, I need to create a certificate and assign it to the servlet > context at run time in Jetty. Is it possible? > > Thanks, > Gaurav > > _______________________________________________ > jetty-users mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/jetty-users > >
_______________________________________________ jetty-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/jetty-users
