How to use the acme.client function in acme

To help you get started, we’ve selected a few acme examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alex / letsencrypt-aws / letsencrypt-aws.py View on Github external
def acme_client_for_private_key(acme_directory_url, private_key):
    return acme.client.Client(
        # TODO: support EC keys, when josepy does.
        acme_directory_url, key=josepy.JWKRSA(key=private_key)
    )
github certbot / certbot / letsencrypt / client.py View on Github external
def acme_from_config_key(config, key):
    "Wrangle ACME client construction"
    # TODO: Allow for other alg types besides RS256
    net = acme_client.ClientNetwork(key, verify_ssl=(not config.no_verify_ssl),
                                    user_agent=_determine_user_agent(config))
    return acme_client.Client(config.server, key=key, net=net)
github certbot / certbot / certbot / certbot / _internal / client.py View on Github external
def acme_from_config_key(config, key, regr=None):
    "Wrangle ACME client construction"
    # TODO: Allow for other alg types besides RS256
    net = acme_client.ClientNetwork(key, account=regr, verify_ssl=(not config.no_verify_ssl),
                                    user_agent=determine_user_agent(config))
    return acme_client.BackwardsCompatibleClientV2(net, key, config.server)
github certbot / certbot / certbot / certbot / _internal / client.py View on Github external
def acme_from_config_key(config, key, regr=None):
    "Wrangle ACME client construction"
    # TODO: Allow for other alg types besides RS256
    net = acme_client.ClientNetwork(key, account=regr, verify_ssl=(not config.no_verify_ssl),
                                    user_agent=determine_user_agent(config))
    return acme_client.BackwardsCompatibleClientV2(net, key, config.server)
github certbot / certbot / tools / chisel2.py View on Github external
def make_client(email=None):
    """Build an acme.Client and register a new account with a random key."""
    key = jose.JWKRSA(key=rsa.generate_private_key(65537, 2048, default_backend()))

    net = acme_client.ClientNetwork(key, verify_ssl=False,
                                    user_agent="Boulder integration tester")

    client = acme_client.Client(DIRECTORY, key=key, net=net)
    tos = client.directory.meta.terms_of_service
    if tos is not None and "Do%20what%20thou%20wilt" in tos:
        net.account = client.register(messages.NewRegistration.from_data(email=email,
            terms_of_service_agreed=True))
    else:
        raise Exception("Unrecognized terms of service URL %s" % tos)
    return client
github certbot / certbot / chisel2.py View on Github external
def make_client(email=None):
    """Build an acme.Client and register a new account with a random key."""
    key = josepy.JWKRSA(key=rsa.generate_private_key(65537, 2048, default_backend()))

    net = acme_client.ClientNetwork(key, acme_version=2,
                                    user_agent="Boulder integration tester")

    client = acme_client.Client(DIRECTORY, key=key, net=net, acme_version=2)
    tos = client.directory.meta.terms_of_service
    if tos is not None and "Do%20what%20thou%20wilt" in tos:
        net.account = client.register(messages.NewRegistration.from_data(email=email,
            terms_of_service_agreed=True))
    else:
        raise Exception("Unrecognized terms of service URL %s" % tos)
    return client
github devopsftw / vergilius / src / vergilius / cert.py View on Github external
def init_acme(self):
        self._acme = client.Client(config.ACME_DIRECTORY_URL, self.acme_key)
        try:
            regr = self._acme.register()
            self._acme.agree_to_tos(regr)
        except Exception as e:
            logger.error('acme certificate provider error: %s' % e)
github certbot / certbot / certbot / client.py View on Github external
def acme_from_config_key(config, key):
    "Wrangle ACME client construction"
    # TODO: Allow for other alg types besides RS256
    net = acme_client.ClientNetwork(key, verify_ssl=(not config.no_verify_ssl),
                                    user_agent=determine_user_agent(config))
    return acme_client.Client(config.server, key=key, net=net)