Skip to content

Commit f6910ba

Browse files
committed
Document that PEM content can be used directly in application.yaml
Closes gh-38210
1 parent 4aba45d commit f6910ba

File tree

1 file changed

+27
-0
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/features

1 file changed

+27
-0
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/ssl.adoc

+27
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,33 @@ When used to secure a client-side connection, a `truststore` is typically config
7777
certificate: "classpath:server.crt"
7878
----
7979

80+
[TIP]
81+
====
82+
PEM content can be used directly for both the `certificate` and `private-key` properties.
83+
If the property values contains `BEGIN` and `END` markers then they will be treated as PEM content rather than a resource location.
84+
85+
The following example shows how a truststore certificate can be defined:
86+
87+
[source,yaml,indent=0,subs="verbatim",configblocks]
88+
----
89+
spring:
90+
ssl:
91+
bundle:
92+
pem:
93+
mybundle:
94+
truststore:
95+
certificate: |
96+
-----BEGIN CERTIFICATE-----
97+
MIID1zCCAr+gAwIBAgIUNM5QQv8IzVQsgSmmdPQNaqyzWs4wDQYJKoZIhvcNAQEL
98+
BQAwezELMAkGA1UEBhMCWFgxEjAQBgNVBAgMCVN0YXRlTmFtZTERMA8GA1UEBwwI
99+
...
100+
V0IJjcmYjEZbTvpjFKznvaFiOUv+8L7jHQ1/Yf+9c3C8gSjdUfv88m17pqYXd+Ds
101+
HEmfmNNjht130UyjNCITmLVXyy5p35vWmdf95U3uEbJSnNVtXH8qRmN9oK9mUpDb
102+
ngX6JBJI7fw7tXoqWSLHNiBODM88fUlQSho8
103+
-----END CERTIFICATE-----
104+
----
105+
====
106+
80107
See {spring-boot-autoconfigure-module-code}/ssl/PemSslBundleProperties.java[PemSslBundleProperties] for the full set of supported properties.
81108

82109

0 commit comments

Comments
 (0)