使用heroku在bundle上获取无效的证书错误

时间:2014-03-26 11:01:49

标签: ruby-on-rails ssl heroku bundler

我有一个托管在云中的私有宝石存储库,可通过https访问。证书有效并签名。

问题是当部署使用此私有仓库的应用程序到Heroku时,我得到了这个输出:

Retrying source fetch due to error (2/3): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://mygemserver.com/.
  There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
  Retrying source fetch due to error (3/3): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://mygemserver.com/.
  There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
  Could not verify the SSL certificate for https://mygemserver.com/.
  There is a chance you are experiencing a man-in-the-middle attack, but most
  likely your system doesn't have the CA certificates needed for verification. For
  information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without
  using SSL, edit your Gemfile sources and change 'https' to 'http'.
  Bundler Output: Fetching source index from https://mygemserver.com/
  Retrying source fetch due to error (2/3): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://mygemserver.com/.
  There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
  Retrying source fetch due to error (3/3): Bundler::Fetcher::CertificateFailureError Could not verify the SSL certificate for https://mygemserver.com/.
  There is a chance you are experiencing a man-in-the-middle attack, but most likely your system doesn't have the CA certificates needed for verification. For information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and change 'https' to 'http'.
  Could not verify the SSL certificate for https://mygemserver.com/.
  There is a chance you are experiencing a man-in-the-middle attack, but most
  likely your system doesn't have the CA certificates needed for verification. For
  information about OpenSSL certificates, see bit.ly/ruby-ssl. To connect without
  using SSL, edit your Gemfile sources and change 'https' to 'http'.
  !
  !     Failed to install gems via Bundler.
  !

  !     Push rejected, failed to compile Ruby app

看起来它无法验证证书。我在本地遇到了同样的问题,并且可以通过运行'rvm osx-ssl-certs update'来修复。此命令更新系统识别的证书包。如何在Heroku中重现此行为?

1 个答案:

答案 0 :(得分:0)

事实证明,我们能够通过将comodo提供的中间证书附加到证书本身来解决这个问题。