简体   繁体   English

使用 docker 和 spring cloud 出现奇怪的 SSL 错误

[英]Strange SSL error using docker and spring cloud

I have a strange problem using feign client in a spring cloud environment.我在 spring 云环境中使用 feign 客户端有一个奇怪的问题。

I use the feign client to connect to an external HTTPS url for a REST call.我使用 feign 客户端连接到外部 HTTPS url 以进行 REST 调用。 The problem is,that every night, server stops docker service to make a backup of volumes.问题是,每天晚上,服务器都会停止 docker 服务来备份卷。 After this,in the morning, i get在这之后,早上,我得到

feign.RetryableException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target executing POST
  1. I thought that is about the certificate, so the first step was to import certificate with keytool into docker container java cacerts file (openjdk-8).我认为这是关于证书的,所以第一步是将带有keytool的证书导入到docker容器java cacerts文件(openjdk-8)中。 (worked after restart of container but still got error in the morning) (重新启动容器后工作,但早上仍然出错)

  2. I was still losing the certificate during night so i created a persistent volume for the store(same result).我在晚上仍然丢失了证书,所以我为商店创建了一个持久卷(结果相同)。

  3. I realized on a dev server that even without importing the certificate into container, i don't get the error anymore after restart of the docker container(just a docker restart {container} and nothing more).我在开发服务器上意识到,即使没有将证书导入容器,在重新启动 docker 容器后我也不会再收到错误消息(只是 docker restart {container} 仅此而已)。

So, each morning after restarting the container, everything runs smoothly.If i don't restart, i get the error.所以,每天早上重新启动容器后,一切运行顺利。如果我不重新启动,我会收到错误消息。 I would like to understand what is happening there so i am open to ideas.我想了解那里发生的事情,所以我对想法持开放态度。 Thanks!谢谢!

I had the same error, caused by root certificate version (unipass in my case).我有同样的错误,由根证书版本(在我的例子中为 unipass)引起。 Check if you have the same root certificate as the client.检查您是否具有与客户端相同的根证书。 Bring them to the same version (if they differ), and the error will disappear.将它们带到相同的版本(如果它们不同),错误就会消失。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM