微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

带有弹簧靴的自签名证书

如何解决带有弹簧靴的自签名证书

我正在尝试访问基于Keycloak的身份验证服务器,该服务器使用自签名证书进行保护。一旦我的客户端应用程序启动,尝试从身份验证服务器加载提供程序元数据时,它将抛出以下错误

Caused by: org.springframework.web.client.ResourceAccessException: I/O error on GET request for "https://localhost:8444/auth/realms/master/.well-kNown/openid-configuration": 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 at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:748) ~[spring-web-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.web.client.RestTemplate.exchange(RestTemplate.java:651) ~[spring-web-5.2.6.RELEASE.jar:5.2.6.RELEASE] at org.springframework.security.oauth2.client.registration.ClientRegistrations.lambda$oidc$0(ClientRegistrations.java:147) ~[spring-security-oauth2-client-5.2.4.RELEASE.jar:5.2.4.RELEASE] at org.springframework.security.oauth2.client.registration.ClientRegistrations.getBuilder(ClientRegistrations.java:195) ~[spring-security-oauth2-client-5.2.4.RELEASE.jar:5.2.4.RELEASE] ... 119 common frames omitted Caused by: 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

我将来自身份验证服务器的证书添加到了我的本地信任存储中,但这不能解决此问题。我看到ClientRegistrations已对RestTemplate进行了硬编码,因此不能被覆盖。除了使用系统属性设置信任库外,没有其他选择。关于该如何解决的任何指示?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。