def _main(domains=[], email=None, hosts=[]): ns = ConfigNamespace(email) config = NamespaceConfig(ns) zope.component.provideUtility(config) ams = AccountMemoryStorage() acc, acme = register(config, ams) authenticator = RpaasLeAuthenticator(hosts=hosts, config=config, name='') installer = None lec = Client(config, acc, authenticator, installer, acme) certr, chain, key, _ = lec.obtain_certificate(domains) return (OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM, certr.body), crypto_util.dump_pyopenssl_chain(chain), key.pem)
def setUp(self): from letsencrypt.account import AccountMemoryStorage self.storage = AccountMemoryStorage()