Compare commits

...

1 Commits

Author SHA1 Message Date
Joona Hoikkala
79bb34c391 Alternative: Work around Basic Authentication for challenge dir 2018-01-23 16:02:09 +02:00
2 changed files with 10 additions and 1 deletions

View File

@@ -19,6 +19,10 @@ class ApacheHttp01(common.TLSSNI01):
Order Allow,Deny Order Allow,Deny
Allow from all Allow from all
</Directory> </Directory>
<Location /.well-known/acme-challenge>
Order Allow,Deny
Allow from all
</Location>
""" """
CONFIG_TEMPLATE24 = """\ CONFIG_TEMPLATE24 = """\
@@ -28,6 +32,9 @@ class ApacheHttp01(common.TLSSNI01):
<Directory {0}> <Directory {0}>
Require all granted Require all granted
</Directory> </Directory>
<Location /.well-known/acme-challenge>
Require all granted
</Location>
""" """
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
@@ -147,4 +154,6 @@ class ApacheHttp01(common.TLSSNI01):
"in: %s", vhost.name, vhost.filep) "in: %s", vhost.name, vhost.filep)
self.configurator.parser.add_dir_beginning( self.configurator.parser.add_dir_beginning(
vhost.path, "Include", self.challenge_conf) vhost.path, "Include", self.challenge_conf)
self.configurator.parser.add_dir(
vhost.path, "Include", self.challenge_conf)
self.moded_vhosts.add(vhost) self.moded_vhosts.add(vhost)

View File

@@ -160,7 +160,7 @@ class ApacheHttp01Test(util.ApacheTest):
matches = self.config.parser.find_dir("Include", matches = self.config.parser.find_dir("Include",
self.http.challenge_conf, self.http.challenge_conf,
vhost.path) vhost.path)
self.assertEqual(len(matches), 1) self.assertEqual(len(matches), 2)
self.assertTrue(os.path.exists(challenge_dir)) self.assertTrue(os.path.exists(challenge_dir))