Berks 安装 SSL_Connect 认证验证失败(法拉第:SSLError)

Berks install SSL_Connect Certification Verify failed (Faraday:SSLError)

作为我正在尝试编写的食谱(新手)的一部分,我使用 berks 安装其他食谱的依赖项,最终当我 运行 berks install 时,我遇到了证书验证错误。任何人都可以帮助我知道可能出了什么问题以及我如何解决这个问题 issue.Thank 你

主厨环境:

Chef Development Kit Version: 0.12.0 chef-client version: 12.8.1 berks version: 4.3.0 kitchen version: 1.6.0

berkshelf

berks -v 4.3.0

berks 安装 - 错误

/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.1/lib/httpclient/ssl_socket.rb:46:in `connect': SSL_connect returned=1 errno=0 state=error: certificate verify failed (Faraday::SSLError)
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.1/lib/httpclient/ssl_socket.rb:46:in `ssl_connect'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.1/lib/httpclient/ssl_socket.rb:24:in `create_socket'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:739:in `block in connect'
from /opt/chefdk/embedded/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'
from /opt/chefdk/embedded/lib/ruby/2.1.0/timeout.rb:101:in `call'
from /opt/chefdk/embedded/lib/ruby/2.1.0/timeout.rb:101:in `timeout'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:735:in `connect'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:497:in `query'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.1/lib/httpclient/session.rb:170:in `query'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.1/lib/httpclient.rb:1238:in `do_get_block'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.1/lib/httpclient.rb:1021:in `block in do_request'
from /opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/httpclient-2.7.

chefdk是一个捆绑在一起的工具集合,虽然你不一定要用,我不用,你可以自己把它们捆绑在一起。

我假设您的 chef 存储库中有一个 Gemfile。如果你不这样做,那么你可以通过执行 bundle init. now use the Gemfile to specify which version of berkshelf you would like to use. once you have it, execute bundle install 轻松创建一个。如果一切顺利,bundle exec berks configure 应该适合您。您可以将其配置为不使用 ssl,或者只需将 ~/.berkshelf/config.json 设置为以下内容:

{
  "ssl": {
    "verify": false
  }
}

希望这能解决您的问题。

在这里,使用 berks 4.3.5,以下工作正常:

{
  "ssl": {
    "verify": false
  },
  "ssl.verify": false
}