knife-soloやchef-soloで"SSL validation of HTTPS requests is disabled."の対処法

knife solo cookやchef-soloしたときに、下記のような警告が出ることがあります。
[2014-09-04T01:17:24+09:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.

To fix this issue add an entry like this to your configuration file:

```
  # Verify all HTTPS connections (recommended)
  ssl_verify_mode :verify_peer

  # OR, Verify only connections to chef-server
  verify_api_cert true
```

To check your SSL configuration, or troubleshoot errors, you can use the
`knife ssl check` command like so:

```
  knife ssl check -c /home/chefsolo/chef-solo/solo.rb
```

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

対処法

knife-soloの最新版を使う
knife-soloの場合は最新版を使いましょう。v0.4.2 以上を使う必要があります。
インストール方法は、ChefDKを入れた上でknife-soloを入れるのがオススメです。
簡単!MacOSXやLinuxにChef,Knife,Berkshelfを一発でインストールしてくれるChefDKの紹介
設定ファイルをいじる
knife-soloの場合は .chef/knife.rbを、chef-soloの場合は solo.rbを編集して下記の1行を追記します。
ssl_verify_mode  :verify_peer
これでプロビジョンし直すと、警告が出なくなるはずです。

参考

https://github.com/matschaffer/knife-solo/pull/363
カテゴリ: