File tree Expand file tree Collapse file tree
pages/spring-cloud-gateway-server-webmvc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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]
You can’t perform that action at this time.
0 commit comments