如何解决HashiCorp Vault + Spring Boot客户端SSL配置
我正在尝试从Spring Boot应用程序连接到Vault服务器。 因此,我浏览了本指南:https://www.baeldung.com/spring-vault 并获取SSLHandshakeException:
WARN o.s.v.a.LifecycleAwareSessionManager - Cannot enhance VaultToken to a LoginToken: Token self-
lookup failed; nested exception is org.springframework.web.client.ResourceAccessException: I/O error
on GET request for
"https://*my vault server*/auth/token/lookup-
self": 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:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
16:49:40.487 [http-nio-8084-exec-1] ERROR o.a.c.c.C.[.[.[.[dispatcherServlet] - Servlet.service() for
servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed;
nested exception is org.springframework.web.client.ResourceAccessException: I/O error on GET request
for "https://*my vault server*/":
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:
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target] with root cause
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path
to requested target
因此,我将keystore.jks放在resources文件夹中,并将以下配置粘贴到application.yml:
spring.cloud.vault:
ssl:
trust-store: classpath:keystore.jks
trust-store-password: changeit
仍然出现错误。我究竟做错了什么? 有什么方法可以像我在Postman中一样将ssl验证设置为false?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。