3

How can I configure a Spring Cloud Gateway server to accept both HTTP and HTTPS connections?

I have SSL configured to port 443 on the Gateway server. I also want to accept HTTP requests on port 80. I know how to do this with a standard Spring Boot application running Tomcat, but I need to know how to configure the Netty server that Gateway uses.

chad
  • 81
  • 2
  • 8

2 Answers2

2

Spring CLoud Gateway Documentation shows the solution: 7. TLS / SSL

Gateway routes can be routed to both http and https backends. If routing to a https backend then the Gateway can be configured to trust all downstream certificates with the following configuration:

application.yml.

spring:
  cloud:
    gateway:
      httpclient:
        ssl:
          useInsecureTrustManager: true
J Hi
  • 55
  • 7
1

So apparently spring cloud gateway uses webflux which does not directly support it, but there are some ways: How to configure in Spring Boot 2 (w/ WebFlux) two ports for HTTP and HTTPS?

Also waiting for a real solution: https://github.com/spring-projects/spring-boot/issues/12035

maslan
  • 2,078
  • 16
  • 34