Ensure client certificate is not checked in python >= 2.7.9.

This commit is contained in:
Albert Cervera i Areny 2015-04-19 01:10:41 +02:00
parent 02189f20e5
commit fcdb38d54f

View file

@ -1,5 +1,7 @@
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
import sys
import ssl
import subprocess
import json
import nmap
@ -57,6 +59,14 @@ class CheckPlan:
for url in urls:
server = ServerProxy(url, verbose=0)
try:
if sys.version_info[:3] < (2, 7, 9):
server = xmlrpclib.ServerProxy(uri, allow_none=True)
else:
ssl_context = ssl.create_default_context()
ssl_context.check_hostname = False
ssl_context.verify_mode = ssl.CERT_NONE
server = xmlrpclib.ServerProxy(uri, allow_none=True,
context=ssl_context)
databases = server.common.db.list(None, None)
except Exception, e:
res.append({