Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

knife-vsphere with SSL (knife ssl) help! #491

Open
ghost opened this issue Dec 17, 2019 · 1 comment
Open

knife-vsphere with SSL (knife ssl) help! #491

ghost opened this issue Dec 17, 2019 · 1 comment

Comments

@ghost
Copy link

ghost commented Dec 17, 2019

I have used the the knife ssl_fetch command to import the certificates into Chef
and the ssl_check command returns:

Connecting to host :443
Successfully verified certificates from `'

nice. now has anyone had any success with using knife-vsphere with SSL??

eg.
when I run a vsphere vm list command with vsinsecure true, the command works (over port 80?) but does not work without vsinsecure true (port 443).

i.e
knife vsphere vm list --recursive --vsuser username --vspass passwordhere --vsdc MYDC --vshost --vsinsecure true

works

knife vsphere vm list --recursive --vsuser username --vspass passwordhere --vsdc MYDC --vshost <my-ip

returns this error:

ERROR: Could not establish a secure connection to the server.
Use knife ssl check to troubleshoot your SSL configuration.
If your 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_connect returned=1 errno=0 state=error: certificate verify failed (unable to get local issuer certificate)

the ssl_check command returns:

Connecting to host :443
Successfully verified certificates from `'

Is this feature working and how is it used?

@swalberg
Copy link
Collaborator

Hi, there are two certificates/services at play here: The Chef API and the vSphere API. The --vsinsecure flag tells the knife-vsphere plugin to ignore certificate validation when talking to the vSphere API even though it continues to use SSL/TLS. The knife ssl check and knife ssl fetch commands only manage the Chef API certificate.

What you're seeing is that without the flag, we're unable to validate the certificate coming back from vSphere against your machine's root certs. The --vsinsecure flag ignores this transgression. If you want to validate the certificate, then vSphere (not Chef) needs a cert that can be validated by your workstation.

Sean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant