Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

HTTS configuration of Spring cloud Gateway

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report