aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/public_key/test/public_key_SUITE.erl20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/public_key/test/public_key_SUITE.erl b/lib/public_key/test/public_key_SUITE.erl
index fcc9bdc080..073bd6f4a2 100644
--- a/lib/public_key/test/public_key_SUITE.erl
+++ b/lib/public_key/test/public_key_SUITE.erl
@@ -989,10 +989,19 @@ pkix_verify_hostname_subjAltName(Config) ->
%% Check that a dns_id does not match a DNS subjAltName wiht wildcard
false = public_key:pkix_verify_hostname(Cert, [{dns_id,"other.example.org"}]),
- %% Check that a dns_id does nmatches a DNS subjAltName wiht wildcard with matchfun
+ %% Check that a dns_id does match a DNS subjAltName wiht wildcard with matchfun
true = public_key:pkix_verify_hostname(Cert, [{dns_id,"other.example.org"}],
[{match_fun, public_key:pkix_verify_hostname_match_fun(https)}
]
+ ),
+
+ %% Check that a uri_id does not match a DNS subjAltName wiht wildcard
+ false = public_key:pkix_verify_hostname(Cert, [{uri_id,"https://other.example.org"}]),
+
+ %% Check that a dns_id does match a DNS subjAltName wiht wildcard with matchfun
+ true = public_key:pkix_verify_hostname(Cert, [{uri_id,"https://other.example.org"}],
+ [{match_fun, public_key:pkix_verify_hostname_match_fun(https)}
+ ]
).
%%--------------------------------------------------------------------
@@ -1040,7 +1049,14 @@ pkix_verify_hostname_options(Config) ->
end}]),
true = public_key:pkix_verify_hostname(Cert, [{uri_id,"https://example.com"}],
[{fqdn_fun, fun(_) -> default end}]),
- false = public_key:pkix_verify_hostname(Cert, [{uri_id,"some://very.wrong.domain"}]).
+ false = public_key:pkix_verify_hostname(Cert, [{uri_id,"some://very.wrong.domain"}]),
+
+ true = public_key:pkix_verify_hostname(Cert, [{dns_id,"example.com"}]),
+ true = public_key:pkix_verify_hostname(Cert, [{dns_id,"abb.bar.example.com"}]),
+ false = public_key:pkix_verify_hostname(Cert, [{dns_id,"example.com"},
+ {dns_id,"abb.bar.example.com"}],
+ [{fqdn_fun,fun(_)->undefined end}]).
+
%%--------------------------------------------------------------------
%% To generate the PEM file contents: