DefaultHostnameVerifier
@Contract(threading=IMMUTABLE) @Deprecated public class StrictHostnameVerifier extends AbstractVerifier
The hostname must match either the first CN, or any of the subject-alts. A wildcard can occur in the CN, and in any of the subject-alts. The one divergence from IE6 is how we only check the first CN. IE6 allows a match against any of the CNs present. We decided to follow in Sun Java 1.4's footsteps and only check the first CN. (If you need to check all the CN's, feel free to write your own implementation!).
A wildcard such as "*.foo.com" matches only subdomains in the same level, for example "a.foo.com". It does not match deeper subdomains such as "a.b.foo.com".
Modifier and Type | Field and Description |
---|---|
static StrictHostnameVerifier |
INSTANCE
Deprecated.
|
Constructor and Description |
---|
StrictHostnameVerifier()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
String |
toString()
Deprecated.
|
void |
verify(String host,
String[] cns,
String[] subjectAlts)
Deprecated.
Checks to see if the supplied hostname matches any of the supplied CNs
or "DNS" Subject-Alts.
|
acceptableCountryWildcard, countDots, getCNs, getDNSSubjectAlts, verify, verify, verify, verify
public static final StrictHostnameVerifier INSTANCE
public final void verify(String host, String[] cns, String[] subjectAlts) throws SSLException
X509HostnameVerifier
host
- The hostname to verify.cns
- CN fields, in order, as extracted from the X.509
certificate.subjectAlts
- Subject-Alt fields of type 2 ("DNS"), as extracted
from the X.509 certificate.SSLException
- if the verification process fails.Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.