2016-05-18 5 views
1

シェフサーバーはCOMPUTE1(大文字)で、ワークステーションはCOMPUTE2(大文字)であり、サーバーにCookbookをアップロードしようとしています。シェフエラー - ホストへのSSL検証の失敗

[email protected]:~/chef-repo$ sudo knife cookbook upload sudo 
Uploading sudo   [0.1.0] 
ERROR: SSL Validation failure connecting to host: compute1 - hostname "compute1" does not match the server certificate 
ERROR: SSL Error connecting to https://compute1/bookshelf/organization-f6706bb676a02d03bc421056986ae96b/checksum-ad104e789f71ad37eed05e4122a4540f?AWSAccessKeyId=548e088de808a684f5e37f97cd23914214c30bf8&Expires=1463546366&Signature=OqudLFc%2BDjjL5jllpCvSdchuLeU%3D, retry 1/5 

-------------------------- 

ERROR: SSL Validation failure connecting to host: compute1 - hostname "compute1" does not match the server certificate 
ERROR: SSL Validation failure connecting to host: compute1 - hostname "compute1" does not match the server certificate 
ERROR: SSL Validation failure connecting to host: compute1 - hostname "compute1" does not match the server certificate 
ERROR: SSL Validation failure connecting to host: compute1 - hostname "compute1" does not match the server certificate 
ERROR: Could not establish a secure connection to the server. 
Use `knife ssl check` to troubleshoot your SSL configuration. 
If your Chef Server uses a self-signed certificate, you can use 
`knife ssl fetch` to make knife trust the server's certificates. 

Original Exception: OpenSSL::SSL::SSLError: SSL Error connecting to https://compute1/bookshelf/organization-f6706bb676a02d03bc421056986ae96b/checksum-1752f5088b4e1ab5a1a872bb87049ae1?AWSAccessKeyId=548e088de808a684f5e37f97cd23914214c30bf8&Expires=1463546371&Signature=IA2GQ%2BfNcc6nm6DCRI/L0NxtkP0%3D - hostname "compute1" does not match the server certificate 
[email protected]:~/chef-repo$ 

ナイフCSLチェックを試みましたが、すべてが正常です。

[email protected]:~/chef-repo$ sudo knife ssl check 
Connecting to host COMPUTE1:443 
Successfully verified certificates from `COMPUTE1' 
[email protected]:~/chef-repo$ 

ナイフSSLはフェッチ私のホスト名が大文字である

[email protected]:~/chef-repo$ sudo knife ssl fetch 
WARNING: Certificates from COMPUTE1 will be fetched and placed in your trusted_cert 
directory (/home/user/chef-repo/.chef/trusted_certs). 

Knife has no means to verify these are the correct certificates. You should 
verify the authenticity of these certificates after downloading. 

Adding certificate for COMPUTE1 in /home/user/chef-repo/.chef/trusted_certs/COMPUTE1.crt 
[email protected]:~/chef-repo$ 

あまりにも正常に動作しています。これがうまくいかないのはなぜですか?いくつかの制限のためにホスト名を変更できません。誰かが助けてくれますか?

おかげで、

+0

ここに表示されていないナイフ設定ファイルがありますか? – Martin

+0

あなたのシェフサーバーのfqdnをショートネームの代わりにknife.rbで使用します。すべてがokです(または、chef_server.rbファイルを更新して、長い名前と短い名前の証明書を生成するように要求します)。https://docs.chef .ioああ、それについての段落) – Tensibai

+0

私は同じ問題があります。問題を解決できましたか? – rtacconi

答えて

-1

This articleは、シェフのサーバーをインストールするには、前提条件を説明します。 IPとFQDNを使用する必要があります。大文字のホスト名は使用しないでください。その実行後:。

sudo chef-server-reconfigure 
sudo cp /var/opt/opscode/nginx/ca/hostxyz009.crt /home/ec2-user/.chef/trusted_certs 
chmod 0644 /home/ec2-user/.chef/trusted_certs/hostxyz009.crt 
ls -l /home/ec2-user/.chef/trusted_certs/ 
knife ssl check 

上記のコードは、ユーザーが(アマゾンLinux)のEC2ユーザーであり、そのナイフとEC2-ユーザーがシェフサーバーにあることを前提としていこの例では、ホスト名はhostxyz009ですが、FQDNはhostxyz009.example.comになる可能性があります

2

この設定では、knife.rbファイルでssl検証を有効にする必要があります。 knife.rbファイルに次の行を追加してください:

ssl_verify_mode :verify_none 
2

少し遅れるかもしれませんが、私はそれが誰かを助けることを願っています。

knife.rbで、以下のエントリを追加:

ssl_verify_modeを:

VERIFY_NONEこれは一時的な問題を解決するだろうが、恒久的な解決策は、あなたのシェフサーバーから証明書をダウンロードすることです。

証明書をダウンロードするには、次の行をknife.rbファイルに追加します。

trusted_certs_dir「#{current_dir}/trusted_certs」

ランあなたは、エントリを追加した後、以下のコマンドを実行します。

ナイフSSLこれは、ディレクトリtrusted_certs下のシェフサーバーから証明書を取得し、保持します(フェッチ)

* .certファイルが既に存在することを確認し、以下のコマンドを実行します。

ナイフのSSLチェックが

あなたは、問題がなくなっているSSL証明書を検証するために、「ナイフノードリスト」を実行することができます(このコマンドは、既にシェフ・サーバーからダウンロードした証明書を検証します)。

+0

私はtrusted_certs_dir "#{current_dir}/trusted_certs"を提供しましたが、同じエラーが発生しています。しかし、ssl_verify_mode:verify_noneは動作しますが、永続的な解決策ではありません。 – Nitul

+0

trusted_certs_dir "#{current_dir}/trusted_certs"を追加したら、ナイフsslフェッチとナイフsslチェックを実行する必要があります。 – tux4linux

関連する問題