Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
dirty work around to make python 2.7.9 work for pyvmomi
diff --git a/samples/ b/samples/
index 1320d05..eafa840 100755
--- a/samples/
+++ b/samples/
@@ -22,6 +22,19 @@ a friendly encouragement to joining the community!
import atexit
import argparse
import getpass
+import requests
+import ssl
+ _create_unverified_https_context = ssl._create_unverified_context
+except AttributeError:
+ # Legacy Python that doesn't verify HTTPS certificates by default
+ pass
+ # Handle target environment that doesn't support HTTPS verification
+ ssl._create_default_https_context = _create_unverified_https_context
from pyVim import connect
from pyVmomi import vmodl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.