summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Styk <mastyk@redhat.com>2019-01-04 11:27:58 +0100
committerMartin Styk <mastyk@redhat.com>2019-01-04 11:30:25 +0100
commit0063f44c9c075cc681a6b426e920cf3c89f2c9c1 (patch)
tree9bf2e6280b05a13aaf2b5f15aabeae0f18c5082e
parentd72e9a28d80ba9169d2ad5acbd589dc34de611d1 (diff)
Common:Add support for insecure calling for XMLRPC
-rw-r--r--Common/bkr/common/hub.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Common/bkr/common/hub.py b/Common/bkr/common/hub.py
index e26b9c6..4292ed8 100644
--- a/Common/bkr/common/hub.py
+++ b/Common/bkr/common/hub.py
@@ -56,6 +56,13 @@ class HubProxy(object):
ssl_context = ssl.create_default_context()
ssl_context.load_verify_locations(cafile=self._conf['CA_CERT'])
transport_args['context'] = ssl_context
+ elif (hasattr(ssl, '_create_unverified_context')
+ and not self._conf.get('SSL_VERIFY', True)):
+ # Python 2.6 doesn't have context argument for xmlrpclib.ServerProxy
+ # therefore transport needs to be modified
+ ssl_context = ssl._create_unverified_context()
+ transport_args['context'] = ssl_context
+
else:
TransportClass = retry_request_decorator(CookieTransport)
self._transport = TransportClass(**transport_args)