X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=manifoldapi%2Fmanifoldapi.py;h=796d0a52dfbe331ca7d03ed46da86267f82bcb48;hb=472832e915d739baf6950262c01d86effe0ae089;hp=8ba7e1557dbb2b29a88cdd915b697267e72c20dc;hpb=1cccda41fd28fdf43fb5731a28ec01c11fe893df;p=unfold.git diff --git a/manifoldapi/manifoldapi.py b/manifoldapi/manifoldapi.py index 8ba7e155..796d0a52 100644 --- a/manifoldapi/manifoldapi.py +++ b/manifoldapi/manifoldapi.py @@ -1,5 +1,5 @@ # Manifold API Python interface -import copy, xmlrpclib +import copy, xmlrpclib, ssl from myslice.configengine import ConfigEngine @@ -41,8 +41,13 @@ class ManifoldAPI: self.calls = {} self.multicall = False self.url = ConfigEngine().manifold_url() - # for more debug on this link, set verbose=True - self.server = xmlrpclib.Server(self.url, verbose=False, allow_none=True) + + # Manifold uses a self signed certificate + # https://www.python.org/dev/peps/pep-0476/ + if hasattr(ssl, '_create_unverified_context'): + self.server = xmlrpclib.Server(self.url, verbose=False, allow_none=True, context=ssl._create_unverified_context()) + else : + self.server = xmlrpclib.Server(self.url, verbose=False, allow_none=True) def __repr__ (self): return "ManifoldAPI[%s]"%self.url