Spring Cloud Config を使用して構成が配布される Spring Boot を使用してマイクロサービスを構築しています。構成アプリケーションで SSL が有効になっています。
スプリング ブート アプリケーションが https 経由で構成サーバーと通信するようにします。問題は、bootstrap.yml から SSL 構成をロードする前に、アプリケーションが構成サーバーへの残りの呼び出しを開始して構成をフェッチし、次のエラーで惨めに失敗することです。
java.lang.IllegalStateException: Could not locate PropertySource and the fail fast property is set, failing
Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://host:8888/abcd/development,production": sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed:
bootstrap.yml で CA 証明書を使用してトラストストアを構成しました。
# MicroServices Properties
spring:
application:
name: abcd
profiles:
active: development,production
cloud:
config:
uri: https://<host>:8888
fail-fast: true
password: abc@123
username: user
server:
ssl:
trust-store: D:/Certs/caCert/server.p12
trust-store-password: keystore
key-store-provider: PKCS12
Config Server との SSL 通信を成功させるにはどうすればよいですか?