public class CertificateFingerprintHostnameVerifier extends Object implements HostnameVerifier
| Constructor and Description |
|---|
CertificateFingerprintHostnameVerifier(Map<String,String> fingerprints) |
CertificateFingerprintHostnameVerifier(Map<String,String> fingerprints,
org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher) |
| Modifier and Type | Method and Description |
|---|---|
CertificateFingerprintHostnameVerifier |
add(String hostname,
String fingerprint) |
protected Certificate |
extractCertificate(SSLSession sslSession) |
protected String |
extractCN(String subjectPrincipal) |
protected List<String> |
extractSubjectAlts(X509Certificate cert,
int subjectType) |
protected void |
matchCN(String host,
String cn,
org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher) |
protected void |
matchDNSName(String host,
List<String> subjectAlts,
org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher) |
protected boolean |
matchDomainRoot(String host,
String domainRoot) |
protected boolean |
matchIdentity(String host,
String identity) |
protected boolean |
matchIdentity(String host,
String identity,
org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher) |
protected boolean |
matchIdentity(String host,
String identity,
org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher,
boolean strict) |
protected boolean |
matchIdentityStrict(String host,
String identity) |
protected boolean |
matchIdentityStrict(String host,
String identity,
org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher) |
protected void |
matchIPAddress(String host,
List<String> subjectAlts) |
protected void |
matchIPv6Address(String host,
List<String> subjectAlts) |
protected String |
normaliseAddress(String hostname) |
boolean |
verify(String s,
SSLSession sslSession) |
protected void |
verify(String host,
X509Certificate cert) |
protected boolean |
verifyFingerprint(String hostname,
Certificate c) |
public CertificateFingerprintHostnameVerifier(Map<String,String> fingerprints)
fingerprints - key: hostname, value: SHA256-Hex Hashpublic CertificateFingerprintHostnameVerifier add(String hostname, String fingerprint)
hostname - the host to addfingerprint - the SHA256-Hex Hashprotected Certificate extractCertificate(SSLSession sslSession)
sslSession - protected void verify(String host, X509Certificate cert) throws SSLException
host - cert - SSLExceptionprotected void matchIPAddress(String host, List<String> subjectAlts) throws SSLException
host - subjectAlts - SSLExceptionprotected void matchIPv6Address(String host, List<String> subjectAlts) throws SSLException
host - subjectAlts - SSLExceptionprotected void matchDNSName(String host, List<String> subjectAlts, org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher) throws SSLException
host - subjectAlts - publicSuffixMatcher - SSLExceptionprotected void matchCN(String host, String cn, org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher) throws SSLException
host - cn - publicSuffixMatcher - SSLExceptionprotected String extractCN(String subjectPrincipal) throws SSLException
subjectPrincipal - SSLExceptionprotected List<String> extractSubjectAlts(X509Certificate cert, int subjectType)
cert - subjectType - protected boolean matchDomainRoot(String host, String domainRoot)
host - domainRoot - protected boolean matchIdentity(String host, String identity, org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher, boolean strict)
host - identity - publicSuffixMatcher - strict - protected boolean matchIdentity(String host, String identity, org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher)
host - identity - publicSuffixMatcher - protected boolean matchIdentity(String host, String identity)
host - identity - protected boolean matchIdentityStrict(String host, String identity, org.apache.http.conn.util.PublicSuffixMatcher publicSuffixMatcher)
host - identity - publicSuffixMatcher - protected boolean matchIdentityStrict(String host, String identity)
host - identity - protected boolean verifyFingerprint(String hostname, Certificate c) throws CertificateEncodingException
hostname - c - CertificateEncodingExceptionpublic boolean verify(String s, SSLSession sslSession)
verify in interface HostnameVerifierCopyright © 2015. All rights reserved.