You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow to configure TrustManagerFactory/KeyManagerFactory via SslBundles for embedded Tomcat #51146
In Spring Boot 3.1 SslBundles were added as concept to configure and update Server keys programmatically.
In my project I'm using the embedded Tomcat server, and I need to use a custom TrustManager. SslManagerBundle allows to configure KeyManagerFactory and TrustManagerFactory. Therefore, I've tried to use it to supply my custom TrustManagerFactory.
Unfortunately, the embedded Tomcat doesn't use SslManagerBundle. (Tomcat's SSLHostConfig creates the instance itself).
Then I've tried to configure "org.apache.tomcat.util.net.SSLHostConfig#truststoreType" via the SSLHostConfig assigned to the connector. But this was also a dead end because "org.springframework.boot.tomcat.SslConnectorCustomizer#addSslHostConfig" creates a new SSLHostConfig and erases all custom changes.
Is there a way to configure a custom TrustManagerFactory for the embedded Tomcat?
It would be nice if "org.springframework.boot.ssl.SslOptions" had properties for TrustManager/KeyManager provider & algorithm. These values could be applied in "SslConnectorCustomizer#applySslBundle" to the newly created SSLHostConfig.
It builds a brand new SSLHostConfig on every pass, so anything you set directly on Tomcat's own SSLHostConfig just gets thrown away next time this runs. And applySslBundle() only pulls sslBundle.getStores() and sslBundle.getKey() (password/alias) off SslOptions — there's no provider or algorithm field on SslOptions at all, so a custom TrustManagerFactory on SslManagerBundle really has nowhere to go right now.
I'd like to take this on — adding provider/algorithm properties to SslOptions and wiring them into applySslBundle() where it builds the trust/key manager config, roughly what you sketched. Since SslOptions is shared, I'll also check Jetty, Undertow, and Reactor Netty to see if they have the same gap before scoping the fix to just Tomcat.
Activity
adityaanikam commentedon Aug 3, 2026
Dug into this a bit —
SslConnectorCustomizer.addSslHostConfig()is the dead end you found:It builds a brand new
SSLHostConfigon every pass, so anything you set directly on Tomcat's ownSSLHostConfigjust gets thrown away next time this runs. AndapplySslBundle()only pullssslBundle.getStores()andsslBundle.getKey()(password/alias) offSslOptions— there's no provider or algorithm field onSslOptionsat all, so a customTrustManagerFactoryonSslManagerBundlereally has nowhere to go right now.I'd like to take this on — adding provider/algorithm properties to
SslOptionsand wiring them intoapplySslBundle()where it builds the trust/key manager config, roughly what you sketched. SinceSslOptionsis shared, I'll also check Jetty, Undertow, and Reactor Netty to see if they have the same gap before scoping the fix to just Tomcat.Merge pull request spring-projects#51466 from scottfrederick