Exemple #1
0
 def setUp(self):
   self.server = implementations.secure_server(
       methods.SERVER_METHODS, 0, resources.private_key(),
       resources.certificate_chain())
   self.server.start()
   port = self.server.port()
   self.stub = implementations.secure_stub(
       methods.CLIENT_METHODS, 'localhost', port,
       resources.test_root_certificates(), None, None,
       server_host_override=_SERVER_HOST_OVERRIDE)
 def setUp(self):
     self.server = implementations.secure_server(
         methods.SERVICE_NAME, methods.SERVER_METHODS, 0,
         resources.private_key(), resources.certificate_chain())
     self.server.start()
     port = self.server.port()
     self.stub = implementations.secure_stub(
         methods.SERVICE_NAME,
         methods.CLIENT_METHODS,
         'localhost',
         port,
         resources.test_root_certificates(),
         None,
         None,
         server_host_override=_SERVER_HOST_OVERRIDE)
Exemple #3
0
def _stub(args):
  if args.use_tls:
    if args.use_test_ca:
      root_certificates = resources.test_root_certificates()
    else:
      root_certificates = resources.prod_root_certificates()

    stub = implementations.secure_stub(
        methods.CLIENT_METHODS, args.server_host, args.server_port,
        root_certificates, None, None,
        server_host_override=args.server_host_override)
  else:
    stub = implementations.insecure_stub(
        methods.CLIENT_METHODS, args.server_host, args.server_port)
  return stub
Exemple #4
0
def _stub(args):
    if args.use_tls:
        if args.use_test_ca:
            root_certificates = resources.test_root_certificates()
        else:
            root_certificates = resources.prod_root_certificates()
        # TODO(nathaniel): server host override.

        stub = implementations.secure_stub(methods.CLIENT_METHODS,
                                           args.server_host, args.server_port,
                                           root_certificates, None, None)
    else:
        stub = implementations.insecure_stub(methods.CLIENT_METHODS,
                                             args.server_host,
                                             args.server_port)
    return stub
Exemple #5
0
def _stub(args):
    if args.use_tls:
        if args.use_test_ca:
            root_certificates = resources.test_root_certificates()
        else:
            root_certificates = resources.prod_root_certificates()

        stub = implementations.secure_stub(
            methods.SERVICE_NAME,
            methods.CLIENT_METHODS,
            args.server_host,
            args.server_port,
            root_certificates,
            None,
            None,
            server_host_override=args.server_host_override)
    else:
        stub = implementations.insecure_stub(methods.SERVICE_NAME,
                                             methods.CLIENT_METHODS,
                                             args.server_host,
                                             args.server_port)
    return stub