【问题标题】:Heroku cert for free dyno does not match it's ulr免费测功机的 Heroku 证书与其网址不匹配
【发布时间】:2017-05-27 17:53:52
【问题描述】:

我正在构建微服务架构中的应用程序。我正在使用 Netflix 的 zuul、eureka 和基于 SpringApplication 的微服务。整个项目将使用免费帐户部署在 Heroku 上。因此,每项服务都是一个单独的应用程序,由 Heroku 通过 https 向公众提供服务。

目前我已经成功部署了 eureka,然后部署了在 eureka 中注册的微服务,然后部署了在 eureka 中注册并从 eureka 获取路由的 zuul。现在我面临 Heroku 证书的问题。当我直接向微服务发送请求时,我会得到响应。当我通过 zuul 发送请求时,我收到 500 错误。翻阅zuul日志我发现:

Caused by: javax.net.ssl.SSLPeerUnverifiedException: Certificate for <ffa57931-eab7-425c-ab80-0ec6fe669a9d.prvt.dyno.rt.heroku.com> doesn't match any of the subject alternative names: [*.herokuapp.com, herokuapp.com]

我找不到配置功能区以接受所有证书的解决方案。所以问题是如何在不使用自定义 ssl 证书的情况下解决这个问题?

【问题讨论】:

  • “ffa57931-eab7-425c-ab80-0ec6fe669a9d.prvt.dyno.rt.heroku.com”值从何而来?
  • @codefinger 请求应该被路由到的微服务地址。它是从尤里卡获得的。
  • 这绝对不是真正的主机名(因为 heroku.com 仅适用于 Heroku 本身)。你确定你没有设置错误的主机名?

标签: java heroku spring-boot ssl-certificate netflix-zuul


【解决方案1】:

好的,我发现了一个问题。使用我指定的 eureka REST API 时:

"hostname": "localhost".

这就是 zuul 尝试将流量路由到
ffa57931-eab7-425c-ab80-0ec6fe669a9d.prvt.dyno.rt.heroku.com 的原因。

相反,我应该使用:

"hostname": <heroku_appname>.herokuapp.com

感谢大家的cmets。希望它会有所帮助,如果有人发现自己遇到了同样的麻烦。

【讨论】:

  • 谢谢你,你拯救了我的一天!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-04-26
  • 2011-10-19
相关资源
最近更新 更多