public class

SslError

extends Object
java.lang.Object
   ↳ android.net.http.SslError

Class Overview

One or more individual SSL errors and the associated SSL certificate

Summary

Constants
int SSL_EXPIRED The certificate has expired
int SSL_IDMISMATCH Hostname mismatch
int SSL_MAX_ERROR The number of different SSL errors (update if you add a new SSL error!!!)
int SSL_NOTYETVALID The certificate is not yet valid
int SSL_UNTRUSTED The certificate authority is not trusted
Public Constructors
SslError(int error, SslCertificate certificate)
Creates a new SSL error set object
SslError(int error, X509Certificate certificate)
Creates a new SSL error set object
Public Methods
boolean addError(int error)
Adds the SSL error to the error set
SslCertificate getCertificate()
int getPrimaryError()
boolean hasError(int error)
String toString()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int SSL_EXPIRED

Since: API Level 8

The certificate has expired

Constant Value: 1 (0x00000001)

public static final int SSL_IDMISMATCH

Since: API Level 8

Hostname mismatch

Constant Value: 2 (0x00000002)

public static final int SSL_MAX_ERROR

Since: API Level 8

The number of different SSL errors (update if you add a new SSL error!!!)

Constant Value: 4 (0x00000004)

public static final int SSL_NOTYETVALID

Since: API Level 8

The certificate is not yet valid

Constant Value: 0 (0x00000000)

public static final int SSL_UNTRUSTED

Since: API Level 8

The certificate authority is not trusted

Constant Value: 3 (0x00000003)

Public Constructors

public SslError (int error, SslCertificate certificate)

Since: API Level 8

Creates a new SSL error set object

Parameters
error The SSL error
certificate The associated SSL certificate

public SslError (int error, X509Certificate certificate)

Since: API Level 8

Creates a new SSL error set object

Parameters
error The SSL error
certificate The associated SSL certificate

Public Methods

public boolean addError (int error)

Since: API Level 8

Adds the SSL error to the error set

Parameters
error The SSL error to add
Returns
  • True iff the error being added is a known SSL error

public SslCertificate getCertificate ()

Since: API Level 8

Returns
  • The SSL certificate associated with the error set

public int getPrimaryError ()

Since: API Level 8

Returns
  • The primary, most severe, SSL error in the set

public boolean hasError (int error)

Since: API Level 8

Parameters
error The SSL error to check
Returns
  • True iff the set includes the error

public String toString ()

Since: API Level 8

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • A String representation of this SSL error object (used mostly for debugging).