0

I am trying to create an offline buildpack on a windows 7 system by following steps in https://github.com/cloudfoundry/java-buildpack/#building-packages. I am failing at this step:

bundle exec rake clean package

Error Logs:

    [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>'

I have referred to bundle install fails with SSL certificate verification error but updating gem didn't help me. I am not sure the role of rvm here, but when I tried to install it using https://rvm.io/rvm/install, I got server timeout from both mentioned servers. Any help is appreciated. Thanks in advance.

humblebee
  • 1,044
  • 11
  • 25

1 Answers1

0

I got the answer myself after some debugging. The container_certificate_trust_store.rb file in lib\java_buildpack\framework directory is configured to pick certificates from a specified path:

  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

There is no default support for Windows. Either add a path for Windows to compile or compile it on a linux machine.

humblebee
  • 1,044
  • 11
  • 25