예제 #1
0
 def setUp(self):
     super(EndpointTests, self).setUp()
     clock = Clock()
     clock.rightNow = (
         datetime.now() - datetime(1970, 1, 1)).total_seconds()
     client = FakeClient(RSA_KEY_512, clock)
     self.endpoint = AutoTLSEndpoint(
         reactor=clock,
         directory=URL.fromText(u'https://example.com/'),
         client_creator=lambda reactor, directory: succeed(client),
         cert_store=MemoryStore(),
         cert_mapping={},
         sub_endpoint=DummyEndpoint())
예제 #2
0
    def setup_method(self):
        self.fake_marathon = FakeMarathon()
        self.fake_marathon_api = FakeMarathonAPI(self.fake_marathon)
        marathon_client = MarathonClient(['http://localhost:8080'],
                                         client=self.fake_marathon_api.client)

        self.cert_store = MemoryStore()

        self.fake_marathon_lb = FakeMarathonLb()
        mlb_client = MarathonLbClient(['http://localhost:9090'],
                                      client=self.fake_marathon_lb.client)

        key = JWKRSA(key=generate_private_key(u'rsa'))
        clock = Clock()
        clock.rightNow = (datetime.now() -
                          datetime(1970, 1, 1)).total_seconds()
        self.txacme_client = FailableTxacmeClient(key, clock)

        self.marathon_acme = MarathonAcme(marathon_client, 'external',
                                          self.cert_store, mlb_client,
                                          lambda: succeed(self.txacme_client),
                                          clock)