1) modifies several pyVim.connect methods to silently disable
SSL verification when connecting to localhost, and
2) adds a small patch to site.py to make it easier to test
this configuration by not throwing away the one good SSL
configuration. I use this patch below to test my change.
Testing Done:
$ python
>>> import ssl
>>> ssl._create_default_https_context = ssl._create_verified_context
>>> from pyVim.connect import SmartConnect
>>> s = SmartConnect() # default host='localhost', no error
>>> s = SmartConnect(host='localhost') # no error
>>> s = SmartConnect(host='127.0.0.1') # no error
>>> s = SmartConnect(host='kevinc-esx.eng.vmware.com')
Traceback (most recent call last):
...
ssl.CertificateError: hostname 'kevinc-esx.eng.vmware.com' doesn't match 'localhost.localdomain'