-
Notifications
You must be signed in to change notification settings - Fork 767
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
No verification of server certificates #13
Comments
I would love that. I'm actually working really closely with Requests in my current position, so I'll see what I can do. |
👍 requests is vastly more useable, and by useable I mean it's harder to make mistakes and easier to get up and running. |
How is this going? I'm willing to slate it for the next release if it's close. |
I noticed this code looks like an attempt to add cert verification but it was commented out for some reason. |
migrate from urllib2 to requests in the connect.py module. starting to fix issue vmware#13
migrate from urllib2 to requests in the connect.py module. starting to fix issue vmware#13
I'm moving this to the next release. We'll accomplish this by moving the library completely onto |
Just as a comment, if certificate verification is added, please make sure there's an option to disable it. |
Actually, I would argue that (in order to maintain compatibility with previous versions) verification should be disabled by default. (not because I think not verifying certificates is a good idea in general, but because it would break API compatibility with previous revisions... and I expect that many people would not bother to configure trusted certificates for this purpose, since pyvmomi will usually be run on what amounts to a relatively trusted network.) |
I'll try and do a pull request for this shortly. My instinct is to add option flags to go with default = disabled through out the API. But, do something clever so that when in a "production" class environment we trip something and fall into enabled. Maybe a magic local environment variable for development? We can discuss it in the pull request. |
I really think that a default option is the right way to go - eliminating surprise. Sites/individuals can wrap that and make their own determination as to whether they want a prod/dev split in how certs are treated. In most ops situations your sysadmins will be much happier if dev/stage/qa/test/ci/production all have the same behavior and the same flags enabled. |
@pcn okay, we'll go with easy first. |
The httplib has already been replaced by request. Thx @michaelrice .Since change 92c1de5, ssoContext can be passed to Connect and SmartConnect to disable the certificate verification. |
Pyvmomi uses httplib and urllib which do no do any certificate verification. But most products do prefer to have some control of how host certificates are verified in order to avoid man-in-the-middle attacks.
Probably the easiest way to get this supported properly is to switch from httplib to python requests - http://docs.python-requests.org/en/latest/
The text was updated successfully, but these errors were encountered: