diff --git a/modules/policy/policy.test.lua b/modules/policy/policy.test.lua index 02f607d666c3bc1d8f2d900223bedf4ab62aa649..ef0fff9aacf9624f9d58de215442aef412395300 100644 --- a/modules/policy/policy.test.lua +++ b/modules/policy/policy.test.lua @@ -20,6 +20,12 @@ local function test_tls_forward() ok(policy.TLS_FORWARD({{'100:dead::', insecure=true}, {'100:dead::@443', insecure=true} }), 'TLS_FORWARD with duplicate IP addresses but different ports is allowed') + ok(policy.TLS_FORWARD({{'100:dead::', insecure=true}, + {'100:beef::', insecure=true} + }), 'TLS_FORWARD with different IPv6 addresses is allowed') + ok(policy.TLS_FORWARD({{'127.0.0.1', insecure=true}, + {'127.0.0.2', insecure=true} + }), 'TLS_FORWARD with different IPv4 addresses is allowed') boom(policy.TLS_FORWARD, {{{'::1', pin_sha256=''}}}, 'TLS_FORWARD with empty pin_sha256') -- boom(policy.TLS_FORWARD, {{{'::1', pin_sha256='ÄŤ'}}}, 'TLS_FORWARD with bad pin_sha256') @@ -38,6 +44,7 @@ local function test_tls_forward() boom(policy.TLS_FORWARD, {{{'::1', hostname='', ca_file='/tmp/ca.crt'}}}, 'TLS_FORWARD with empty hostname + CA cert') boom(policy.TLS_FORWARD, {{{'::1', hostname='test.', ca_file='/dev/a_file_which_surely_does_NOT_exist!'}}}, 'TLS_FORWARD with hostname + unreadable CA cert') + end return {