Skip to content

Most visited

Recently visited

navigation
added in API level 1
Deprecated since API level 22

AbstractVerifier

public abstract class AbstractVerifier
extends Object implements X509HostnameVerifier

java.lang.Object
   ↳ org.apache.http.conn.ssl.AbstractVerifier
Known Direct Subclasses


This class was deprecated in API level 22.
Please use openConnection() instead. Please visit this webpage for further details.

Abstract base class for all standard X509HostnameVerifier implementations.

Summary

Public constructors

AbstractVerifier()

Public methods

static boolean acceptableCountryWildcard(String cn)
static int countDots(String s)

Counts the number of dots "." in a string.

static String[] getCNs(X509Certificate cert)
static String[] getDNSSubjectAlts(X509Certificate cert)

Extracts the array of SubjectAlt DNS names from an X509Certificate.

final void verify(String host, SSLSocket ssl)
final void verify(String host, String[] cns, String[] subjectAlts, boolean strictWithSubDomains)
final void verify(String host, X509Certificate cert)
final boolean verify(String host, SSLSession session)

Verify that the host name is an acceptable match with the server's authentication scheme.

Inherited methods

From class java.lang.Object
From interface org.apache.http.conn.ssl.X509HostnameVerifier
From interface javax.net.ssl.HostnameVerifier

Public constructors

AbstractVerifier

added in API level 1
AbstractVerifier ()

Public methods

acceptableCountryWildcard

added in API level 1
boolean acceptableCountryWildcard (String cn)

Parameters
cn String

Returns
boolean

countDots

added in API level 1
int countDots (String s)

Counts the number of dots "." in a string.

Parameters
s String: string to count dots from

Returns
int number of dots

getCNs

added in API level 1
String[] getCNs (X509Certificate cert)

Parameters
cert X509Certificate

Returns
String[]

getDNSSubjectAlts

added in API level 1
String[] getDNSSubjectAlts (X509Certificate cert)

Extracts the array of SubjectAlt DNS names from an X509Certificate. Returns null if there aren't any.

Note: Java doesn't appear able to extract international characters from the SubjectAlts. It can only extract international characters from the CN field.

(Or maybe the version of OpenSSL I'm using to test isn't storing the international characters correctly in the SubjectAlts?).

Parameters
cert X509Certificate: X509Certificate

Returns
String[] Array of SubjectALT DNS names stored in the certificate.

verify

added in API level 1
void verify (String host, 
                SSLSocket ssl)

Parameters
host String

ssl SSLSocket

Throws
IOException

verify

added in API level 1
void verify (String host, 
                String[] cns, 
                String[] subjectAlts, 
                boolean strictWithSubDomains)

Parameters
host String

cns String

subjectAlts String

strictWithSubDomains boolean

Throws
SSLException

verify

added in API level 1
void verify (String host, 
                X509Certificate cert)

Parameters
host String

cert X509Certificate

Throws
SSLException

verify

added in API level 1
boolean verify (String host, 
                SSLSession session)

Verify that the host name is an acceptable match with the server's authentication scheme.

Parameters
host String: the host name

session SSLSession: SSLSession used on the connection to host

Returns
boolean true if the host name is acceptable

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.