由于证书问题,cloudfoundry buildpack编译失败

时间:2017-05-28 13:43:05

标签: ruby-on-rails ssl-certificate cloudfoundry buildpack

我正在尝试按照https://github.com/cloudfoundry/java-buildpack/#building-packages中的步骤在Windows 7系统上创建脱机buildpack。我在这一步失败了:

  

捆绑exec rake清洁包

错误日志:

    [DownloadCache]                  WARN  Unable to download https://java-buildpack.cloudfoundry.org/groovy/index.yml into cache build/staging/resources/cache: SSL_connect returned=1 errno=0 state=error: certificate verify failed
rake aborted!
Unable to find cached file for https://java-buildpack.cloudfoundry.org/groovy/index.yml
C:/rover/buildpack_release/java-buildpack-master/lib/java_buildpack/util/cache/download_cache.rb:74:in `get'
C:/rover/buildpack_release/java-buildpack-master/rakelib/dependency_cache_task.rb:166:in `get_from_cache'
C:/rover/buildpack_release/java-buildpack-master/rakelib/dependency_cache_task.rb:158:in `block (2 levels) in uris'
C:/rover/buildpack_release/java-buildpack-master/rakelib/dependency_cache_task.rb:156:in `each'
C:/rover/buildpack_release/java-buildpack-master/rakelib/dependency_cache_task.rb:156:in `block in uris'
C:/rover/buildpack_release/java-buildpack-master/rakelib/dependency_cache_task.rb:155:in `each'
C:/rover/buildpack_release/java-buildpack-master/rakelib/dependency_cache_task.rb:155:in `uris'
C:/rover/buildpack_release/java-buildpack-master/rakelib/dependency_cache_task.rb:44:in `initialize'
C:/rover/buildpack_release/java-buildpack-master/Rakefile:40:in `new'
C:/rover/buildpack_release/java-buildpack-master/Rakefile:40:in `<top (required)>'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/rake_module.rb:28:in `load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:687:in `raw_load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:96:in `block in load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:95:in `load_rakefile'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:79:in `block in run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:178:in `standard_exception_handling'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/lib/rake/application.rb:77:in `run'
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
C:/Ruby22-x64/bin/rake:23:in `load'
C:/Ruby22-x64/bin/rake:23:in `<main>'

我已经提到了bundle install fails with SSL certificate verification error,但更新gem并没有帮助我。我不确定rvm在这里的作用,但是当我尝试使用https://rvm.io/rvm/install安装它时,我从两个提到的服务器获得了服务器超时。 任何帮助表示赞赏。提前谢谢。

1 个答案:

答案 0 :(得分:0)

经过一些调试后,我自己得到了答案。 lib \ java_buildpack \ framework目录中的container_certificate_trust_store.rb文件配置为从指定路径中选择证书:

  DARWIN_CERTIFICATES = Pathname.new('<path to cert.pem>').freeze

  UNIX_CERTIFICATES = Pathname.new('<path to ca-certificates.crt>').freeze

  private_constant :DARWIN_CERTIFICATES, :UNIX_CERTIFICATES

  def ca_certificates
    if `uname -s` =~ /Darwin/
      DARWIN_CERTIFICATES
    else
      UNIX_CERTIFICATES
    end
  end

Windows没有默认支持。为Windows添加路径以在Linux机器上编译或编译它。

相关问题