I have installed chef-dk and started using berkshelf but berks upload failed

纵饮孤独 提交于 2019-11-29 07:29:21

It is failing the SSL verification process. Follow these instructions to fix it for knife. For berkshelf you can disable SSL verification in your config.json or you can set $SSL_CERT_FILE to the downloaded server certificate.

This is a berks related issue.
You can cancel the ssl verify option in berks config file:

echo '{"ssl": { "verify": false }}' > ~/.berkshelf/config.json

As I'm a big fan of fixing the error instead of fixing the symptom here is what you can do to be sure the SSL connection works with validation (with a little more detail than coderanger one):

1) Get the server certificate and add it to the cacert.pem file of chef-dk

openssl s_client -showcerts -connect <YOUR_CHEF_SERVER>:443 </dev/null 2>/dev/null|openssl x509 -outform PEM >> /opt/chefdk/embedded/ssl/certs/cacert.pem

2) set the env variables for ssl libs:

export SSL_CERT_FILE=/opt/chefdk/embedded/ssl/certs/cacert.pem

Retry your upload and it should work.

You can also disable ssl checking on the command line:

berks upload --no-ssl-verify
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!