public class SslError extends Object
This class provides methods for performing operations on SSL errors, such as adding and querying errors. SSL errors are stored by bit, and so multiple SSL errors can be added.
| 限定符和类型 | 字段 | 说明 |
|---|---|---|
static int |
SSL_CERT_AUTHORITY_INVALID |
Indicates that the certificate authority is not trusted.
|
static int |
SSL_CERT_DATE_INVALID |
Indicates that the certificate date is invalid.
|
static int |
SSL_CERT_EXPIRED |
Indicates that the certificate has expired.
|
static int |
SSL_CERT_INVALID |
Indicates that the certificate is invalid due to any other error.
|
static int |
SSL_CERT_NAME_INVALID |
Indicates that the hostname is not matched.
|
static int |
SSL_CERT_NOT_YET_VALID |
Indicates that the certificate has not taken effect.
|
| 构造器 | 说明 |
|---|---|
SslError(int error,
X509Certificate x509Certificate,
String url) |
A constructor used to create an
SslError instance with a specified SSL error, SSL certificate, and URL. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
addError(int error) |
Adds a specified SSL error to this
SslError object. |
X509Certificate |
getCertificate() |
Obtains the SSL certificate of this
SslError object. |
int |
getCriticalError() |
Obtains the most severe SSL error in this
SslError object. |
String |
getUrl() |
Obtains the URL of this
SslError object. |
boolean |
hasError(int error) |
Checks whether this
SslError object contains a specified SSL error. |
String |
toString() |
Composes all the members and their values in the class into a string in sequence.
|
public static final int SSL_CERT_AUTHORITY_INVALID
public static final int SSL_CERT_DATE_INVALID
public static final int SSL_CERT_EXPIRED
public static final int SSL_CERT_INVALID
public static final int SSL_CERT_NAME_INVALID
public static final int SSL_CERT_NOT_YET_VALID
public SslError(int error,
X509Certificate x509Certificate,
String url)
SslError instance with a specified SSL error, SSL certificate, and URL.error - Indicates the SSL error.x509Certificate - Indicates the SSL certificate. Currently, only an X.509 certificate is supported.url - Indicates the URL, which can be null.public boolean addError(int error)
SslError object.error - Indicates the SSL error to add.
SSL_CERT_NOT_YET_VALIDSSL_CERT_EXPIREDSSL_CERT_NAME_INVALIDSSL_CERT_AUTHORITY_INVALIDSSL_CERT_DATE_INVALIDSSL_CERT_INVALIDtrue if the SSL error is added; returns false otherwise.public boolean hasError(int error)
SslError object contains a specified SSL error.error - Indicates the SSL error to check for.true if this SslError object contains the specified SSL error;
returns false otherwise.public X509Certificate getCertificate()
SslError object.public int getCriticalError()
SslError object.public String getUrl()
SslError object.