_create_unverified_context is not always available
Message-ID: <55966f11.g4SzQ+CRgSdd5znz%ab(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: b7e0692fca5b61d3c01ab9fdaff0859668914c51
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b7e0692fca5b61…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Jul 3 13:15:46 2015 +0200
updated #2398: sanity check: _create_unverified_context is not always available
---
agents/special/agent_vsphere | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agents/special/agent_vsphere b/agents/special/agent_vsphere
index 608d383..c06721d 100755
--- a/agents/special/agent_vsphere
+++ b/agents/special/agent_vsphere
@@ -660,7 +660,7 @@ def encode_url(text):
try:
netloc = host_address + ":" + str(opt_port)
- if opt_no_cert:
+ if opt_no_cert and hasattr(ssl, '_create_unverified_context'):
import ssl
server_handle = httplib.HTTPSConnection(netloc, context =
ssl._create_unverified_context())
else: