Ejemplo n.º 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)
Ejemplo n.º 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)
        self.transport.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()
Ejemplo n.º 3
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)
     self.transport.timeout = 1
     self.proxy = xmlrpclib.ServerProxy('https://%s:%s' % (HOST, port),
                                        transport=self.transport)
Ejemplo n.º 4
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)
        self.transport.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()