chad
chad

Reputation: 91

Spring Cloud Gateway listen to both HTTP and HTTPS?

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.

Upvotes: 3

Views: 7313

Answers (2)

J Hi
J Hi

Reputation: 55

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

Upvotes: 2

maslan
maslan

Reputation: 2178

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

Upvotes: 2

Related Questions