Use os.path.normcase to have Windows compatible challenge paths on Windows (#8599)

* Use os.path.normcase to have Windows compatible challenge paths on Windows.

* Add integration test and fix lint
This commit is contained in:
Adrien Ferrand
2021-01-13 14:38:57 -08:00
committed by GitHub
parent 13d4a99251
commit c0917a0302
2 changed files with 13 additions and 1 deletions
@@ -148,6 +148,17 @@ def test_certonly(context):
"""Test the certonly verb on certbot.""" """Test the certonly verb on certbot."""
context.certbot(['certonly', '--cert-name', 'newname', '-d', context.get_domain('newname')]) context.certbot(['certonly', '--cert-name', 'newname', '-d', context.get_domain('newname')])
assert_cert_count_for_lineage(context.config_dir, 'newname', 1)
def test_certonly_webroot(context):
"""Test the certonly verb with webroot plugin"""
with misc.create_http_server(context.http_01_port) as webroot:
certname = context.get_domain('webroot')
context.certbot(['certonly', '-a', 'webroot', '--webroot-path', webroot, '-d', certname])
assert_cert_count_for_lineage(context.config_dir, certname, 1)
def test_auth_and_install_with_csr(context): def test_auth_and_install_with_csr(context):
"""Test certificate issuance and install using an existing CSR.""" """Test certificate issuance and install using an existing CSR."""
+2 -1
View File
@@ -157,7 +157,8 @@ to serve all files under specified web root ({0})."""
"--webroot-path and --domains, or --webroot-map. Run with " "--webroot-path and --domains, or --webroot-map. Run with "
" --help webroot for examples.") " --help webroot for examples.")
for name, path in path_map.items(): for name, path in path_map.items():
self.full_roots[name] = os.path.join(path, challenges.HTTP01.URI_ROOT_PATH) self.full_roots[name] = os.path.join(path, os.path.normcase(
challenges.HTTP01.URI_ROOT_PATH))
logger.debug("Creating root challenges validation dir at %s", logger.debug("Creating root challenges validation dir at %s",
self.full_roots[name]) self.full_roots[name])