设为首页 加入收藏

TOP

微服务网关 —— SpringCloud Gateway(三)
2023-09-09 10:25:56 】 浏览:74
Tags:SpringCloud Gateway
: 5s # 响应超时,单位为 java.time.Duration

2. 每个路由配置

spring:
  cloud:
    gateway:
      routes:
        - id: per_route_timeouts
          uri: http://example.org
          predicates:
            - Path=/user-service/**
          metadata:
          	response-timeout: 200 # 响应超时,单位为毫秒
          	connect-timeout: 200 # 连接超时配置,单位为毫秒

TLS/SSL 设置

在 Web 服务应用中,为了数据的传输安全,会使用安全证书以及 TLS/SSL 加密,Gateway 可以通过遵循常规的 Spring 服务器配置来侦听 HTTPS 上的请求

server:
	ssl:
		# 启用ssl
		enabled: true
		# 启用证书
		key-alias: scg
		# 证书密码
		key-store-password: scg1234
		# 证书地址
		key-store: classpath:scg-keystore.pl2
		# 证书类型
		key-store-type: PKCS12

可以使用以下配置为 Gateway 配置一组可信任的已知证书

spring:
  cloud:
    gateway:
    	httpclient:
    		ssl:
    			trustedX509Certificates:
                - certl.pem
                - cert2.pem
首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇浅谈eureka的保护机制 下一篇RocketMQ 入门实战(2)--安装

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目