vmware-archive / vsphere-flocker-driver

vSphere Flocker driver
Other
24 stars 16 forks source link

SSL error when using pyvmomi 6.0.0 #9

Closed jm66 closed 8 years ago

jm66 commented 8 years ago

When using pyvmomi-6.0.0 I get the following connection errors:

2016-01-28 14:08:00,716 - vsphere_blockdevice - DEBUG - __init__: vsphere __init__ : 7599ce94-4e1c-458f-8eff-4479edd74ecc: <local.ip>: <uname>r: <pw>: <DC> <DS>
2016-01-28 14:08:00,723 - connectionpool - INFO - _new_conn: Starting new HTTPS connection (1): <IP>

Looks like _connect needs to add the new sslContext to the SmartConnect function. Something like:

               self._si = SmartConnect(host=self._vc_ip, port=443,
                                        user=self._username, pwd=self._password,
                                        sslContext=ssl._create_unverified_context())

This might be validated against a parameter in agent.yml such as validate_cert: no perhaps. Does that make sense?

Thanks

pratikvgupta commented 8 years ago

The fix looks ok. Were you able to verify the fix ?

jm66 commented 8 years ago

Hi @pratikvgupta Yes, I've tested the fix.

pratikvgupta commented 8 years ago

Can you send a pull request for this fix? I will approve the same.