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

时间:2016-04-14 13:09:02

标签: chef berkshelf test-kitchen

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

厨师环境:

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 install - 错误

/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.

2 个答案:

答案 0 :(得分:9)

chefdk是捆绑在一起的工具集合,虽然您不必使用它,但我不这样做,您可以自己将它们捆绑在一起。

我假设您的Gemfile存储库中有chef。如果不这样做,那么您可以通过执行bundle init轻松创建一个。现在使用Gemfile指定您要使用的version berkshelf。完成后,执行bundle install。如果一切顺利,bundle exec berks configure应该适合你。您可以将其配置为不使用ssl,或仅将~/.berkshelf/config.json与以下内容放在一起:

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

希望这能解决您的问题。

答案 1 :(得分:2)

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

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