Skip to content

Commit 15bd55a

Browse files
authored
Merge pull request #4156 from 03hjain/issue-3654-document-tls-ssl-mvc-gateway
Document TLS/SSL configuration for Spring Cloud MVC Gateway
2 parents 4163851 + 7dc4794 commit 15bd55a

2 files changed

Lines changed: 67 additions & 0 deletions

File tree

docs/modules/ROOT/nav.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
** xref:spring-cloud-gateway-server-webmvc/httpheadersfilters.adoc[]
114114
** xref:spring-cloud-gateway-server-webmvc/writing-custom-predicates-and-filters.adoc[]
115115
** xref:spring-cloud-gateway-server-webmvc/working-with-servlets-and-filters.adoc[]
116+
** xref:spring-cloud-gateway-server-webmvc/tls-and-ssl.adoc[]
116117
117118
// begin Gateway Proxy Exchange
118119

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
[[tls-and-ssl]]
2+
= TLS and SSL
3+
4+
Spring Cloud MVC Gateway uses Spring Boot's `RestClient` infrastructure for backend proxy calls.
5+
TLS/SSL configuration for those backend calls is handled through Spring Boot's `spring.http.client` and `spring.ssl.bundle` properties.
6+
7+
NOTE: The `spring.cloud.gateway.mvc.http-client.ssl-bundle` property is deprecated since Spring Cloud Gateway 4.2.0
8+
in favor of `spring.http.client.ssl.bundle`.
9+
10+
== Examples
11+
12+
=== Configure an SSL Bundle (JKS)
13+
14+
Below is an example of how to define a JKS-based SSL bundle and reference:
15+
16+
.application.yml
17+
[source,yaml]
18+
----
19+
spring:
20+
http:
21+
client:
22+
ssl:
23+
bundle: mybundle
24+
connect-timeout: 5s
25+
read-timeout: 30s
26+
ssl:
27+
bundle:
28+
jks:
29+
mybundle:
30+
key-store:
31+
location: classpath:keystore.jks
32+
password: changeit
33+
trust-store:
34+
location: classpath:truststore.jks
35+
password: changeit
36+
----
37+
38+
=== Configure PEM Certificates
39+
40+
Below is an example of how to configure an SSL bundle using PEM-formatted certificates and private keys:
41+
42+
.application.yml
43+
[source,yaml]
44+
----
45+
spring:
46+
http:
47+
client:
48+
ssl:
49+
bundle: mybundle
50+
ssl:
51+
bundle:
52+
pem:
53+
mybundle:
54+
keystore:
55+
certificate: classpath:client-cert.pem
56+
key: classpath:client-key.pem
57+
truststore:
58+
certificate: classpath:ca-cert.pem
59+
----
60+
61+
== Related Spring Boot Documentation
62+
63+
For full details on SSL bundle configuration and available properties, see:
64+
65+
* https://docs.spring.io/spring-boot/appendix/application-properties/index.html#application-properties.web.spring.http.client.ssl.bundle[spring.http.client.ssl.bundle reference]
66+
* https://docs.spring.io/spring-boot/reference/features/ssl.html[Spring Boot SSL documentation]

0 commit comments

Comments
 (0)