Search code examples
sslnginxchef-infraknife

Chef ssl validation failure


I have one chef-server version 12.0.1 and can connect linux (rhel/centos) systems to the chef-server with knife bootstrap but cannot with windows and locally on my rhel client knife ssl check fails.

I have two problems but I think they are both related.

Problem 1 - knife ssl check fails:

Connecting to host chef-server:443
ERROR: The SSL certificate of chef-server could not be verified

Problem 2 - bootstrap windows server fails:

ERROR: SSL Validation failure connecting to host: chef-server - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Chef encountered an error attempting to create the client "desktop"

I have tried a number of things: 1) knife ssl fetch - no changes 2) I have a signed digicert crt on the server which is accepted by the management-console and chrome web browser 3) I have changed set this in the chef-server.rb

nginx['ssl_certificate'] = "/var/opt/opscode/nginx/ca/hostname.crt"
nginx['ssl_certificate_key'] = "/var/opt/opscode/nginx/ca/hostname.key"

which go to the signed certs.

Anything else I should be trying or am I being a plank?


Solution

  • Try running these commands on your Chef server:

    mkdir /root/.chef/trusted_certs    
    cp /var/opt/chef-server/nginx/ca/YOUR_SERVER'S_HOSTNAME.crt /root/.chef/trusted_certs/   
    

    I was having the same problem and it was fixed after I looked through this article, and tried out the steps it gave: http://jtimberman.housepub.org/blog/2014/12/11/chef-12-fix-untrusted-self-sign-certs/