Exemplo n.º 1
0
 def setUp(self):
     self.namespace = mock.MagicMock(
         config_dir='/tmp/config', work_dir='/tmp/foo', foo='bar',
         server='https://acme-server.org:443/new',
         dvsni_port=1234, simple_http_port=4321)
     from letsencrypt.configuration import NamespaceConfig
     self.config = NamespaceConfig(self.namespace)
Exemplo n.º 2
0
    def test_absolute_paths(self):
        from letsencrypt.configuration import NamespaceConfig

        config_base = "foo"
        work_base = "bar"
        logs_base = "baz"

        mock_namespace = mock.MagicMock(spec=[
            'config_dir', 'work_dir', 'logs_dir', 'http01_port',
            'tls_sni_01_port', 'domains', 'server'
        ])
        mock_namespace.config_dir = config_base
        mock_namespace.work_dir = work_base
        mock_namespace.logs_dir = logs_base
        config = NamespaceConfig(mock_namespace)

        self.assertTrue(os.path.isabs(config.config_dir))
        self.assertEqual(config.config_dir,
                         os.path.join(os.getcwd(), config_base))
        self.assertTrue(os.path.isabs(config.work_dir))
        self.assertEqual(config.work_dir, os.path.join(os.getcwd(), work_base))
        self.assertTrue(os.path.isabs(config.logs_dir))
        self.assertEqual(config.logs_dir, os.path.join(os.getcwd(), logs_base))
        self.assertTrue(os.path.isabs(config.accounts_dir))
        self.assertTrue(os.path.isabs(config.backup_dir))
        self.assertTrue(os.path.isabs(config.csr_dir))
        self.assertTrue(os.path.isabs(config.in_progress_dir))
        self.assertTrue(os.path.isabs(config.key_dir))
        self.assertTrue(os.path.isabs(config.temp_checkpoint_dir))
Exemplo n.º 3
0
Arquivo: le.py Projeto: vfiebig/rpaas
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)
Exemplo n.º 4
0
    def test_absolute_paths(self):
        from letsencrypt.configuration import NamespaceConfig
        from letsencrypt.configuration import RenewerConfiguration

        config_base = "foo"
        work_base = "bar"
        logs_base = "baz"

        mock_namespace = mock.MagicMock(spec=[
            'config_dir', 'work_dir', 'logs_dir', 'http01_port',
            'tls_sni_01_port', 'domains', 'server'
        ])
        mock_namespace.config_dir = config_base
        mock_namespace.work_dir = work_base
        mock_namespace.logs_dir = logs_base
        config = RenewerConfiguration(NamespaceConfig(mock_namespace))

        self.assertTrue(os.path.isabs(config.archive_dir))
        self.assertTrue(os.path.isabs(config.live_dir))
        self.assertTrue(os.path.isabs(config.renewal_configs_dir))
        self.assertTrue(os.path.isabs(config.renewer_config_file))