W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
網(wǎng)關(guān)可以通過遵循常規(guī)的Spring服務(wù)器配置來偵聽https上的請求。例:
application.yml。
server: ssl: enabled: true key-alias: scg key-store-password: scg1234 key-store: classpath:scg-keystore.p12 key-store-type: PKCS12
網(wǎng)關(guān)路由可以同時路由到http和https后端。如果路由到https后端,則可以使用以下配置將網(wǎng)關(guān)配置為信任所有下游證書:
application.yml。
spring: cloud: gateway: httpclient: ssl: useInsecureTrustManager: true
使用不安全的信任管理器不適用于生產(chǎn)。對于生產(chǎn)部署,可以為網(wǎng)關(guān)配置一組可以通過以下配置信任的已知證書:
application.yml。
spring: cloud: gateway: httpclient: ssl: trustedX509Certificates: - cert1.pem - cert2.pem
如果Spring Cloud網(wǎng)關(guān)未配置受信任的證書,則使用默認的信任存儲(可以使用系統(tǒng)屬性javax.net.ssl.trustStore覆蓋)。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: