Skip to content

Commit

Permalink
test: fix SSLSNITest
Browse files Browse the repository at this point in the history
  • Loading branch information
NiccoMlt committed Dec 10, 2024
1 parent 3c76956 commit 2f96899
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,16 +254,16 @@ public static boolean certificateMatches(
if (certificate.getSubjectAltNames() == null || certificate.getSubjectAltNames().isEmpty()) {
if (exact) {
return !certificate.isWildcard() && hostname.equals(certificate.getHostname());
} else {
return certificate.isWildcard() && hostname.endsWith(certificate.getHostname());
}
return certificate.isWildcard() && hostname.endsWith(certificate.getHostname());
}
for (final var name : certificate.getNames()) {
final var wildcard = isWildcard(name);
if (exact) {
return !wildcard && hostname.equals(name);
} else {
return wildcard && hostname.endsWith(removeWildcard(name));
for (final String name : certificate.getNames()) {
final boolean wildcard = isWildcard(name);
if (exact && !wildcard && hostname.equals(name)) {
return true;
}
if (!exact && wildcard && hostname.endsWith(CertificatesUtils.removeWildcard(name))) {
return true;
}
}
return false;
Expand Down

0 comments on commit 2f96899

Please sign in to comment.