Safeguard
Developer Tools•

What are Spring Boot SSL bundles and how do they help?

SSL bundles name a set of trust material, JKS or PEM, and reuse it across web server and clients. What to configure and what to keep out of properties.

Safeguard Security Team
3 min read

An SSL bundle is a named set of trust material, such as a keystore or truststore, defined under the spring.ssl.bundle prefix and referred to by name wherever Spring Boot configures a secure connection. It centralises certificate settings for the embedded web server and for clients, so each connection does not carry its own copy.

Definitions

  • Keystore: holds your own certificate and private key, used when your app presents an identity.
  • Truststore: holds certificates your app trusts, used when it calls another service.
  • Bundle: a user named group of those settings.

The Spring Boot SSL documentation says properties with the prefix spring.ssl.bundle specify named sets of trust material, and that bundles can be applied to several types of connections.

Two formats

FormatPrefixHolds
Java KeyStorespring.ssl.bundle.jksJKS or PKCS12 files made with keytool
PEMspring.ssl.bundle.pemPEM encoded certificate and private key text

Instead of a file location you can supply Base64 encoded content that starts with base64, and PEM text can be placed directly in the property if it has BEGIN and END markers. If you set a bundle through environment variables, the bundle name is always converted to lowercase.

Why it helps security

  • One bundle, one place to review and rotate.
  • Web server, data clients and REST clients can share a bundle by name rather than copying keystore settings.
  • Spring auto configures an SslBundles bean, so code can fetch a bundle and build clients consistently instead of using system wide trust settings.

What to avoid

The docs' own examples show keystore passwords in properties. That is fine for illustration but not for production. Keep passwords out of files in the artifact and read them from a secret store, as described in how to read secrets in Spring Boot. Also avoid embedding private keys on the classpath inside a jar, because anyone with the jar has the key.

Steps

  1. Inventory every keystore and truststore your app uses today.
  2. Define a named bundle per purpose, for example one for inbound and one for a partner API.
  3. Reference bundles by name in server and client configuration.
  4. Source passwords and keys from mounted secrets, not from the packaged jar.
  5. Document expiry dates and rotate before they pass.
  6. Review any code that disables certificate checks. That is a separate bug, found through code review rather than a dependency scan.

Safeguard scans dependencies, produces SBOMs and uses reachability analysis to show which findings your code can actually reach. You can run a free scan at gold.safeguard.sh/scan.

Quick check

Can I use PEM files instead of a keystore?

Yes. The docs support PEM bundles through the spring.ssl.bundle.pem prefix.

Does a bundle replace certificate validation?

No. It supplies trust material. Validation still happens in the client or server using it.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.