def test_110_005(self):
     dns = [self.NAME1, self.NAME1, self.NAME1]
     md = TestEnv.a2md(["update", self.NAME1, "domains"] +
                       dns)['jout']['output'][0]
     assert md['name'] == self.NAME1
     assert md['domains'] == [self.NAME1]
 def test_110_006(self):
     dns = [self.NAME1, "xn--kller-jua.punycode.de"]
     md = TestEnv.a2md(["update", self.NAME1, "domains"] +
                       dns)['jout']['output'][0]
     assert md['name'] == self.NAME1
     assert md['domains'] == dns
Beispiel #3
0
def teardown_module(module):
    print("teardown_module module:%s" % module.__name__)
    assert TestEnv.apache_stop() == 0
 def test_110_008(self, wildDNS):
     assert TestEnv.a2md(["update", self.NAME1, "domains",
                          wildDNS])['rv'] == 0
Beispiel #5
0
    def test_8003(self):
        domain = self.test_domain
        dns_list = [domain]

        conf = HttpdConf()
        conf.add_admin("admin@" + domain)
        conf.add_must_staple("on")
        conf.add_md(dns_list)
        conf.add_vhost(TestEnv.HTTPS_PORT, domain, aliasList=[])
        conf.install()

        assert TestEnv.apache_restart() == 0
        assert TestEnv.await_completion([domain])
        assert TestEnv.apache_restart() == 0
        TestEnv.check_md_complete(domain)
        cert1 = CertUtil(TestEnv.store_domain_file(domain, 'pubcert.pem'))
        assert cert1.get_must_staple()

        # toggle MDMustStaple off, expect a cert that has it disabled
        conf = HttpdConf()
        conf.add_admin("admin@" + domain)
        conf.add_must_staple("off")
        conf.add_md(dns_list)
        conf.add_vhost(TestEnv.HTTPS_PORT, domain, aliasList=[])
        conf.install()

        assert TestEnv.apache_restart() == 0
        assert TestEnv.await_completion([domain])
        assert TestEnv.apache_restart() == 0
        TestEnv.check_md_complete(domain)
        cert1 = CertUtil(TestEnv.store_domain_file(domain, 'pubcert.pem'))
        assert not cert1.get_must_staple()

        # toggle MDMustStaple on again, expect a cert that has it enabled
        conf = HttpdConf()
        conf.add_admin("admin@" + domain)
        conf.add_must_staple("on")
        conf.add_md(dns_list)
        conf.add_vhost(TestEnv.HTTPS_PORT, domain, aliasList=[])
        conf.install()

        assert TestEnv.apache_restart() == 0
        assert TestEnv.await_completion([domain])
        assert TestEnv.apache_restart() == 0
        TestEnv.check_md_complete(domain)
        cert1 = CertUtil(TestEnv.store_domain_file(domain, 'pubcert.pem'))
        assert cert1.get_must_staple()
Beispiel #6
0
 def setup_method(self, method):
     print("setup_method: %s" % method.__name__)
     TestEnv.check_acme()
     TestEnv.clear_store()
 def test_110_305(self, url):
     md = TestEnv.a2md(["update", self.NAME1, "contacts",
                        url])['jout']['output'][0]
     assert md['contacts'] == [url]
     assert md['state'] == 1
Beispiel #8
0
 def get_client_status(self, domain):
     return TestEnv.run([
         "openssl", "s_client", "-status", "-connect",
         "%s:%s" % (TestEnv.HTTPD_HOST, TestEnv.HTTPS_PORT), "-CAfile",
         "gen/ca.pem", "-servername", domain, "-showcerts"
     ])
 def test_110_302(self):
     assert TestEnv.a2md(
         ["update", self.NAME1, "contacts",
          "*****@*****.**"])['rv'] == 0
     assert TestEnv.a2md(["update", self.NAME1, "contacts"])['rv'] == 1
 def test_110_304(self, invalidMail):
     # SEI: Uhm, es ist nicht sinnvoll, eine komplette verification von
     # https://tools.ietf.org/html/rfc822 zu bauen?
     assert TestEnv.a2md(["update", self.NAME1, "contacts",
                          invalidMail])['rv'] == 1
 def test_110_301(self):
     mail = ["*****@*****.**", "*****@*****.**"]
     md = TestEnv.a2md(["update", self.NAME1, "contacts"] +
                       mail)['jout']['output'][0]
     assert md['contacts'] == ["mailto:" + mail[0], "mailto:" + mail[1]]
     assert md['state'] == 1
def setup_module(module):
    print("setup_module: %s" % module.__name__)
    TestEnv.init()
    TestEnv.a2md_stdargs([TestEnv.A2MD, "-d", TestEnv.STORE_DIR, "-j"])
    TestEnv.a2md_rawargs([TestEnv.A2MD, "-d", TestEnv.STORE_DIR])
 def test_110_101(self, invalidURL):
     assert TestEnv.a2md(["update", self.NAME1, "ca",
                          invalidURL])['rv'] == 1
 def setup_class(cls):
     print("setup_class:%s" % cls.__name__)
     TestEnv.init()
     TestEnv.clear_store()
     TestEnv.check_acme()
     cls.domain = TestEnv.get_class_domain(cls)
     cls.mdA = "a-" + cls.domain
     cls.mdB = "b-" + cls.domain
     cls.configure_httpd([cls.mdA, cls.mdB]).install()
     assert TestEnv.apache_restart() == 0
     assert TestEnv.await_completion([cls.mdA, cls.mdB])
     TestEnv.check_md_complete(cls.mdA)
     TestEnv.check_md_complete(cls.mdB)
 def test_110_404(self, invalidURL):
     assert TestEnv.a2md(["update", self.NAME1, "agreement",
                          invalidURL])['rv'] == 1
 def teardown_class(cls):
     print("teardown_class:%s" % cls.__name__)
     assert TestEnv.apache_stop() == 0
 def test_110_001(self):
     assert TestEnv.a2md(["update", self.NAME1, "domains"])['rv'] == 1
Beispiel #18
0
 def setup_method(self, method):
     print("setup_method: %s" % method.__name__)
     TestEnv.apache_err_reset()
     TestEnv.clear_store()
     self.test_domain = TestEnv.get_method_domain(method)
 def test_110_002(self, invalidDNS):
     assert TestEnv.a2md(["update", self.NAME1, "domains",
                          invalidDNS])['rv'] == 1
Beispiel #20
0
def setup_module(module):
    print("setup_module: %s" % module.__name__)
    TestEnv.initv1()
 def test_110_003(self):
     dns = [self.NAME1, self.NAME2]
     assert TestEnv.a2md(["update", self.NAME1, "domains"] + dns)['rv'] == 1
 def setup_method(self, method):
     print("setup_method: %s" % method.__name__)
     TestEnv.initv2()
     TestEnv.clear_store()
     self.test_domain = TestEnv.get_method_domain(method)
 def test_110_004(self):
     dns = ["test-foo.com", "sub.test-foo.com"]
     md = TestEnv.a2md(["update", self.NAME1, "domains"] +
                       dns)['jout']['output'][0]
     assert md['name'] == self.NAME1
     assert md['domains'] == dns
Beispiel #24
0
 def _check_md_names(self, name, dns_list):
     md = TestEnv.a2md([ "-j", "list", name ])['jout']['output'][0]
     assert md['name'] == name
     assert md['domains'] == dns_list
 def test_110_007(self):
     assert TestEnv.a2md(
         ["update", "test-foo.com", "domains", "test-foo.com"])['rv'] == 1