Example #1
0
 def __init__(self, port, key_file, cert_file):
     self.transport = VerifyingSafeTransport(key_file=key_file,
                                             cert_file=cert_file,
                                             ca_certs=CRT_FILE,
                                             cert_reqs=ssl.CERT_REQUIRED,
                                             timeout=1)
     self.proxy = xmlrpclib.ServerProxy('https://%s:%s' % (HOST, port),
                                        transport=self.transport)
Example #2
0
class VerifyingClient:
    def __init__(self, port, key_file, cert_file):
        self.transport = VerifyingSafeTransport(
            key_file=key_file, cert_file=cert_file, ca_certs=CRT_FILE, cert_reqs=ssl.CERT_REQUIRED, timeout=1
        )
        self.proxy = xmlrpclib.ServerProxy("https://%s:%s" % (HOST, port), transport=self.transport)

    def add(self, numer1, number2):
        return self.proxy.add(numer1, number2)

    def close(self):
        if hasattr(self.transport, "close"):
            self.transport.close()
Example #3
0
class VerifyingClient():
    def __init__(self, port, key_file, cert_file):
        self.transport = VerifyingSafeTransport(key_file=key_file,
                                                cert_file=cert_file,
                                                ca_certs=CRT_FILE,
                                                cert_reqs=ssl.CERT_REQUIRED,
                                                timeout=1)
        self.proxy = xmlrpclib.ServerProxy('https://%s:%s' % (HOST, port),
                                           transport=self.transport)

    def add(self, numer1, number2):
        return self.proxy.add(numer1, number2)

    def close(self):
        if hasattr(self.transport, 'close'):
            self.transport.close()
Example #4
0
 def __init__(self, port, key_file, cert_file):
     self.transport = VerifyingSafeTransport(key_file=key_file,
                                             cert_file=cert_file,
                                             ca_certs=CRT_FILE,
                                             cert_reqs=ssl.CERT_REQUIRED,
                                             timeout=1)
     self.proxy = xmlrpclib.ServerProxy('https://%s:%s' % (HOST, port),
                                        transport=self.transport)