Add a check for custom host to ingress TLS integration test

This commit is contained in:
Kyle Havlovitz 2020-05-01 13:55:13 -07:00 committed by Chris Piraino
parent 0c22eacca8
commit b2a0251f66
2 changed files with 11 additions and 1 deletions

View File

@ -12,10 +12,11 @@ config_entries {
listeners = [ listeners = [
{ {
port = 9999 port = 9999
protocol = "tcp" protocol = "http"
services = [ services = [
{ {
name = "s1" name = "s1"
hosts = ["test.example.com"]
} }
] ]
} }

View File

@ -32,3 +32,12 @@ load helpers
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
[ "$output" = "hello" ] [ "$output" = "hello" ]
} }
@test "should be able to connect to s1 through the TLS-enabled ingress port using the custom host" {
assert_dnssan_in_cert localhost:9999 'test.example.com'
run retry_default curl --cacert <(get_ca_root) -s -f -d hello \
--resolve test.example.com:9999:127.0.0.1 \
https://test.example.com:9999
[ "$status" -eq 0 ]
[ "$output" = "hello" ]
}