- api_inst= xmlrpclib.Server( vars['BOOT_API_SERVER'], verbose=0 )
- except KeyError, e:
- raise BootManagerException, \
- "configuration file does not specify API server URL"
+ server_url = vars['BOOT_API_SERVER']
+ except:
+ raise BootManagerException("configuration file does not specify API server URL")
+
+ api_inst = None
+ # preferred strategy : select tlsv1 as the encryption protocol
+ try:
+ ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
+ api_inst = xmlrpclib.ServerProxy(server_url,
+ context=ssl_context,
+ verbose=0)
+ # this is only supported in python >= 2.7.9 though, so allow for failure
+ except:
+ print("Default xmlrpclib strategy failed")
+ import traceback
+ traceback.print_exc()
+ pass