From ffb302ccca647984a9903074fd3ac97ba701741e Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Tue, 6 Jun 2017 17:18:42 +0200
Subject: [PATCH] fence_vmware_soap: fix for selfsigned certificate
---
fence/agents/vmware_soap/fence_vmware_soap.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index 93f96583..007a1c67 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -42,7 +42,10 @@ def soap_login(options):
if options.has_key("--ssl") or options.has_key("--ssl-secure") or options.has_key("--ssl-insecure"):
if options.has_key("--ssl-insecure"):
+ import ssl
from requests.packages.urllib3.exceptions import InsecureRequestWarning
+ if hasattr(ssl, '_create_unverified_context'):
+ ssl._create_default_https_context = ssl._create_unverified_context
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
verify = False
else: