{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef-dk/issues/319","labels_url":"https://api.github.com/repos/chef/chef-dk/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef-dk/issues/319/comments","events_url":"https://api.github.com/repos/chef/chef-dk/issues/319/events","html_url":"https://github.com/chef/chef-dk/issues/319","id":57625370,"number":319,"title":"knife ssl check failure on Windows 7","user":{"login":"joelwilson","id":2030867,"avatar_url":"https://avatars.githubusercontent.com/u/2030867?v=3","gravatar_id":"","url":"https://api.github.com/users/joelwilson","html_url":"https://github.com/joelwilson","followers_url":"https://api.github.com/users/joelwilson/followers","following_url":"https://api.github.com/users/joelwilson/following{/other_user}","gists_url":"https://api.github.com/users/joelwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/joelwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelwilson/subscriptions","organizations_url":"https://api.github.com/users/joelwilson/orgs","repos_url":"https://api.github.com/users/joelwilson/repos","events_url":"https://api.github.com/users/joelwilson/events{/privacy}","received_events_url":"https://api.github.com/users/joelwilson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-13T17:07:06Z","updated_at":"2015-02-13T17:17:32Z","closed_at":"2015-02-13T17:17:32Z","body":"`kniffe ssl fetch` works, but `knife ssl check` fails on Win 7. I'm running ChefDk 0.3.6 against a Chef 12 server running on Ubuntu 14.04 at EC2. `U:\\` is my home directory.\r\n\r\n```\r\nPS U:\\> knife ssl fetch\r\nWARNING: Certificates from chefserv01.companyname.com will be fetched and placed in your trusted_cert\r\ndirectory (U:/.chef\\trusted_certs).\r\n\r\nKnife has no means to verify these are the correct certificates. You should\r\nverify the authenticity of these certificates after downloading.\r\n\r\nAdding certificate for chefserv01.companyname.com in U:/.chef\\trusted_certs/chefserv01_companyname_com.crt\r\n\r\nPS U:\\> knife ssl check\r\nConnecting to host chefserv01.companyname.com:443\r\nERROR: The SSL certificate of chefserv01.companyname.com could not be verified\r\nCertificate issuer data: /C=US/ST=WA/L=Seattle/O=YouCorp/OU=Operations/CN=chefserv01.companyname.com/emailAddress=you@example.com\r\n \r\nConfiguration Info:\r\n \r\nOpenSSL Configuration:\r\n* Version: OpenSSL 1.0.0l 6 Jan 2014\r\n* Certificate file: C:/Users/Luis/Code/luislavena/knap-build/var/knapsack/software/x86-windows/openssl/1.0.0n/ssl/cert.pem\r\n* Certificate directory: C:/Users/Luis/Code/luislavena/knap-build/var/knapsack/software/x86-windows/openssl/1.0.0n/ssl/certs\r\nChef SSL Configuration:\r\n* ssl_ca_path: nil\r\n* ssl_ca_file: \"C:/opscode/chefdk/embedded/ssl/certs/cacert.pem\"\r\n* trusted_certs_dir: \"U:/.chef\\\\trusted_certs\"\r\n \r\nTO FIX THIS ERROR:\r\n \r\nIf the server you are connecting to uses a self-signed certificate, you must\r\nconfigure chef to trust that server's certificate.\r\n \r\nBy default, the certificate is stored in the following location on the host\r\nwhere your chef-server runs:\r\n \r\n  /var/opt/chef-server/nginx/ca/SERVER_HOSTNAME.crt\r\n \r\nCopy that file to you trusted_certs_dir (currently: U:/.chef\\trusted_certs)\r\nusing SSH/SCP or some other secure method, then re-run this command to confirm\r\nthat the server's certificate is now trusted.\r\n```\r\n\r\nFWIW, I had trouble with `berks` a while back and implemented the [SSL_CERT_FILE fix](https://github.com/chef/chef-dk/issues/106).\r\n"},"comment":{"url":"https://api.github.com/repos/chef/chef-dk/issues/comments/74289899","html_url":"https://github.com/chef/chef-dk/issues/319#issuecomment-74289899","issue_url":"https://api.github.com/repos/chef/chef-dk/issues/319","id":74289899,"user":{"login":"joelwilson","id":2030867,"avatar_url":"https://avatars.githubusercontent.com/u/2030867?v=3","gravatar_id":"","url":"https://api.github.com/users/joelwilson","html_url":"https://github.com/joelwilson","followers_url":"https://api.github.com/users/joelwilson/followers","following_url":"https://api.github.com/users/joelwilson/following{/other_user}","gists_url":"https://api.github.com/users/joelwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/joelwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joelwilson/subscriptions","organizations_url":"https://api.github.com/users/joelwilson/orgs","repos_url":"https://api.github.com/users/joelwilson/repos","events_url":"https://api.github.com/users/joelwilson/events{/privacy}","received_events_url":"https://api.github.com/users/joelwilson/received_events","type":"User","site_admin":false},"created_at":"2015-02-13T17:17:32Z","updated_at":"2015-02-13T17:17:32Z","body":"Well I just got this working after finding [this blog post](http://hedge-ops.com/solving-ssl-validation-failure-with-knife/). The fix was to set the `trusted_certs_dir` in my knife.rb:\r\n\r\n    trusted_certs_dir          'U:/.chef/trusted_certs`\r\n\r\n```\r\nPS U:\\> knife ssl fetch\r\nWARNING: Certificates from chefserv01.companyname.com will be fetched and placed in your trusted_cert\r\ndirectory (U:\\/.chef/trusted_certs).\r\n\r\nKnife has no means to verify these are the correct certificates. You should\r\nverify the authenticity of these certificates after downloading.\r\n\r\nAdding certificate for chefserv01.companyname.com in U:\\/.chef/trusted_certs/chefserv01_companyname_com.crt\r\nPS U:\\> knife ssl check\r\nConnecting to host chefserv01.companyname.com:443\r\nSuccessfully verified certificates from `chefserv01.companyname.com'\r\nPS U:\\>\r\n```\r\n\r\nMy guess is it didn't work with the default path because of my strange home directory setup, but I have not verified.\r\n\r\nPlease re-open if this is determined to be a bug."}}