TLS と SSL
Spring Cloud MVC Gateway は、バックエンドプロキシ呼び出しに Spring Boot の RestClient インフラストラクチャを使用します。これらのバックエンド呼び出しの TLS/SSL 構成は、Spring Boot の spring.http.client および spring.ssl.bundle プロパティを通じて処理されます。
spring.cloud.gateway.mvc.http-client.ssl-bundle プロパティは Spring Cloud Gateway 4.2.0 以降非推奨となり、spring.http.client.ssl.bundle が推奨されています。 |
サンプル
SSL バンドルの設定 (JKS)
以下は、JKS ベースの SSL バンドルと参照を定義する方法の例です。
application.yml
spring:
http:
client:
ssl:
bundle: mybundle
connect-timeout: 5s
read-timeout: 30s
ssl:
bundle:
jks:
mybundle:
key-store:
location: classpath:keystore.jks
password: changeit
trust-store:
location: classpath:truststore.jks
password: changeitConfigure PEM Certificates
Below is an example of how to configure an SSL bundle using PEM-formatted certificates and private keys:
application.yml
spring:
http:
client:
ssl:
bundle: mybundle
ssl:
bundle:
pem:
mybundle:
keystore:
certificate: classpath:client-cert.pem
key: classpath:client-key.pem
truststore:
certificate: classpath:ca-cert.pem