fix: ignore https mappings when no ssl certificate exists

This fixes issues where users may somehow add an https mapping but are missing an ssl certificate, causing nginx to not load properly. We now ignore the mapping and warn users of the misconfiguration.

Closes #5368
This commit is contained in:
Jose Diaz-Gonzalez committed 2022-10-22 17:47:54 -04:00
1 parent d0966ce3d4
commit 4ef260f57a
3 files changed
+45 -2

No files matched your search

+24
View File
@@ -116,3 +116,27 @@ teardown() {
echo "status: $status"
assert_output_contains "45s;" 0
}
@test "(nginx-vhosts) nginx:build-config ignore bad https mapping" {
setup_test_tls
run deploy_app "dockerfile-noexpose"
echo "output: $output"
echo "status: $status"
assert_output_contains "Ignoring detected https port mapping without an accompanying ssl certificate" 0
teardown_test_tls
run /bin/bash -c "dokku proxy:report $TEST_APP --proxy-port-map"
echo "output: $output"
echo "status: $status"
assert_output "http:80:5000 https:443:5000"
run /bin/bash -c "dokku nginx:build-config $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_output_contains "Ignoring detected https port mapping without an accompanying ssl certificate" 1
run /bin/bash -c "dokku proxy:report $TEST_APP --proxy-port-map"
echo "output: $output"
echo "status: $status"
assert_output "http:80:5000 https:443:5000"
}