Document TLS/SSL Configuration for Spring Cloud MVC Gateway
Feature Request: TLS/SSL Configuration for Spring Cloud MVC Gateway
Description: Currently, Spring Cloud Reactor Gateway provides properties to configure TLS and SSL settings for the HTTP client. However, Spring Cloud MVC Gateway lacks similar configuration options. This feature request is to add support for configuring TLS and SSL properties in Spring Cloud MVC Gateway using application properties.
Proposed Solution:
Add properties to the application.properties or application.yml file to configure TLS and SSL settings for the HTTP client in Spring Cloud MVC Gateway. These properties should include options for specifying the key store, trust store, protocols, and other relevant SSL/TLS settings.
Example Configuration:
spring.mvc.gateway.httpclient.ssl.key-store=classpath:keystore.jks
spring.mvc.gateway.httpclient.ssl.key-store-password=changeit
spring.mvc.gateway.httpclient.ssl.trust-store=classpath:truststore.jks
spring.mvc.gateway.httpclient.ssl.trust-store-password=changeit
spring.mvc.gateway.httpclient.ssl.protocol=TLS
Benefits:
- Enhanced security by allowing users to configure SSL/TLS settings.
- Consistency with Spring Cloud Reactor Gateway, making it easier for users to switch between the two.
- Simplified configuration management through application properties.
Use Cases:
- Secure communication between the MVC Gateway and backend services.
- Compliance with security policies requiring specific SSL/TLS configurations.
References:
- Spring Cloud Gateway Documentation
- Spring Boot SSL Configuration
- Spring Cloud Gateway Reactive Server TLS and SSL Configuration
Thank you for considering this feature request. I'm happy to submit a PR for the changes.
The ssl link for boot is for the server. This is for the RestClient which is what would need to be used https://docs.spring.io/spring-boot/reference/io/rest-client.html#io.rest-client.restclient.ssl
PRs welcome.
Actually, this is already supported by spring.http.client properties https://docs.spring.io/spring-boot/appendix/application-properties/index.html#application-properties.web.spring.http.client.ssl.bundle
See https://github.com/spring-cloud/spring-cloud-gateway/commit/55124043ac50c28f487d68c948a00c20acdeede0
Let's turn this into an issue for documentation.
Sorry, I was not aware, I had to create beans for rest clients with SSL Context to enable m-tls. And how do we turn this into a note?
No worries, it should probably be a new file in https://github.com/spring-cloud/spring-cloud-gateway/tree/main/docs/modules/ROOT/pages/spring-cloud-gateway-server-webmvc
Okay, I will add the documentation