# Register chef client to server failed

**URL:** <https://discourse.chef.io/t/register-chef-client-to-server-failed/12906>\
**Category:** Chef Infra (archive)\
**Created:** [April 13, 2018, 3:08am UTC](https://discourse.chef.io/t/register-chef-client-to-server-failed/12906 "2018-04-13T03:08:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jasonchu](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@Jasonchu](https://discourse.chef.io/u/Jasonchu)\
**Post date:** [April 13, 2018, 3:08am UTC](https://discourse.chef.io/t/register-chef-client-to-server-failed/12906/1 "2018-04-13T03:08:43Z")

</div>

the chef client first run need register to chef server, i am suffering a problem.

My step is:  
1.create a barebone /etc/chef/chient.rb:  
log\_level :info  
log\_location STDOUT  
chef\_server\_url ‘http:// ip-172-31-9-42’  
validation\_client\_name ‘validation.pem’

note:the validation.pem from chef server /etc/chef/

1. and use the command to register: chef-client -120

# Chef encountered an error attempting to create the client “ip-172-31-14-120.cn-north-1.compute.internal”

## System Info:

chef\_version=14.0.190  
ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [x86\_64-linux]  
program\_name=chef-client worker: ppid=5225;start=01:53:26;  
executable=/opt/chef/bin/chef-client

Running handlers:  
[2018-04-13T01:53:27+00:00] ERROR: Running exception handlers  
Running handlers complete  
[2018-04-13T01:53:27+00:00] ERROR: Exception handlers complete  
Chef Client failed. 0 resources updated in 01 seconds  
[2018-04-13T01:53:27+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out  
[2018-04-13T01:53:27+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report  
[2018-04-13T01:53:27+00:00] ERROR: SSL Error connecting to [https://ip-172-31-9-42/organizations/geekrainy/clients](https://ip-172-31-9-42/organizations/geekrainy/clients) - SSL\_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate)  
[2018-04-13T01:53:27+00:00] ERROR: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Starting Chef Client, version 14.0.190  
Creating a new client identity for ip-172-31-14-120.cn-north-1.compute.internal using the validator key.  
[2018-04-13T01:55:29+00:00] ERROR: SSL Validation failure connecting to host: ip-172-31-9-42 - SSL\_connect returned=1 errno=0 state=error: certificate verify failed (self signed certificate)

---

<div class="post-metadata">

**Author:** ![Galen\_Emery1](https://avatars.discourse-cdn.com/v4/letter/g/46a35a/32.png) [@Galen\_Emery1](https://discourse.chef.io/u/Galen_Emery1)\
**Post date:** [April 13, 2018, 5:10am UTC](https://discourse.chef.io/t/register-chef-client-to-server-failed/12906/2 "2018-04-13T05:10:30Z")

</div>

Your error is that the chef-client is rejecting the chef-server’s SSL  
certificate for being self-signed:

```auto
ERROR: SSL Validation failure connecting to host: ip-172-31-9-42 -
SSL_connect returned=1 errno=0 state=error: certificate verify failed (self
signed certificate)

```

you can resolve this by either replacing the certificate with one issued  
from a CA, or by telling the node to skip ssl verification.

to skip verification add `ssl_verify_mode :verify_none`

You could also add the Chef-Server’s certificate into the node’s trusted  
certificates.

---

<div class="post-metadata">

**Author:** ![Jasonchu](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@Jasonchu](https://discourse.chef.io/u/Jasonchu)\
**Post date:** [April 16, 2018, 12:50am UTC](https://discourse.chef.io/t/register-chef-client-to-server-failed/12906/3 "2018-04-16T00:50:15Z")

</div>

Thank you very much! the registering is successfully！
