Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

HTTS configuration of Spring cloud Gateway

Shulou Source: shulou.com Published: 2022-06-02 04:05:10 11月07日 Update

This article focuses on "HTTS configuration of Spring cloud Gateway". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the HTTS configuration of Spring cloud Gateway.

TLS/ SSL configuration

TLS: secure Transport layer Protocol (TLS) is used to provide confidentiality and data integrity between two communication applications

SSL:SSL (Secure Sockets Layer secure Sockets layer) and its successor Transport layer Security (Transport Layer Security,TLS) are security protocols that provide security and data integrity for network communications. TLS and SSL encrypt the network connection between the transport layer and the application layer.

The configuration SSL in application.yml is as follows:

Server: ssl: enabled: true key-alias: scg key-store-password: scg1234 key-store: classpath:scg-keystore.p12 key-store-type: PKCS12

Spring Cloud Gateway can route requests to http or https services. If you are routing requests to https services, you can make the gateway trust the certificates of all subsequent services through the following configuration:

Spring: cloud: gateway: httpclient: ssl: useInsecureTrustManager: true

This configuration method is not suitable for production environment, where you can configure some trusted certificates here in the gateway, as shown in the following configuration:

Spring: cloud: gateway: httpclient: ssl: trustedX509Certificates:-cert1.pem-cert2.pem

If no trusted certificates are configured for the gateway, these default certificates will be used, but these configurations can be overridden by the system property settings (javax.net.ssl.trustStore).

TLS handshake (TLS Handshake)

In a Spring Cloud Gateway service, there is a client connection pool that is used to route requests to the service in the background. When using Https communication, the client initializes an TLS handshake, which can be configured with a timeout, as shown below:

Spring: cloud: gateway: httpclient: ssl: handshake-timeout-millis: 10000 close-notify-flush-timeout-millis: 3000 close-notify-read-timeout-millis: 0 so far, I believe you have a deeper understanding of "HTTS configuration of Spring cloud Gateway". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Configuration security services certificates gateways routing transport communication between content integrity customer data environment network learning applications production utility deeper Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info macOS Linux Docker Huawei