public
class
SslError
extends Object
java.lang.Object | |
↳ | android.net.http.SslError |
This class represents a set of one or more SSL errors and the associated SSL certificate.
Constants | |
---|---|
int |
SSL_DATE_INVALID
The date of the certificate is invalid |
int |
SSL_EXPIRED
The certificate has expired |
int |
SSL_IDMISMATCH
Hostname mismatch |
int |
SSL_INVALID
A generic error occurred |
int |
SSL_MAX_ERROR
This constant was deprecated in API level 14. This constant is not necessary for using the SslError API and can change from release to release. |
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)
This constructor was deprecated
in API level 14.
Use |
|
SslError(int error, X509Certificate certificate)
This constructor was deprecated
in API level 14.
Use |
|
SslError(int error, SslCertificate certificate, String url)
Creates a new SslError object using the supplied error, certificate and URL. |
|
SslError(int error, X509Certificate certificate, String url)
Creates a new SslError object using the supplied error, certificate and URL. |
Public methods | |
---|---|
boolean
|
addError(int error)
Adds the supplied SSL error to the set. |
SslCertificate
|
getCertificate()
Gets the SSL certificate associated with this object. |
int
|
getPrimaryError()
Gets the most severe SSL error in this object's set of errors. |
String
|
getUrl()
Gets the URL associated with this object. |
boolean
|
hasError(int error)
Determines whether this object includes the supplied error. |
String
|
toString()
Returns a string representation of this object. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
int SSL_DATE_INVALID
The date of the certificate is invalid
Constant Value: 4 (0x00000004)
int SSL_EXPIRED
The certificate has expired
Constant Value: 1 (0x00000001)
int SSL_IDMISMATCH
Hostname mismatch
Constant Value: 2 (0x00000002)
int SSL_INVALID
A generic error occurred
Constant Value: 5 (0x00000005)
int SSL_MAX_ERROR
This constant was deprecated
in API level 14.
This constant is not necessary for using the SslError API and
can change from release to release.
The number of different SSL errors.
Constant Value: 6 (0x00000006)
int SSL_NOTYETVALID
The certificate is not yet valid
Constant Value: 0 (0x00000000)
int SSL_UNTRUSTED
The certificate authority is not trusted
Constant Value: 3 (0x00000003)
SslError (int error, SslCertificate certificate)
This constructor was deprecated
in API level 14.
Use SslError(int, SslCertificate, String)
Creates a new SslError object using the supplied error and certificate. The URL will be set to the empty string.
Parameters | |
---|---|
error |
int :
The SSL error |
certificate |
SslCertificate :
The associated SSL certificate |
SslError (int error, X509Certificate certificate)
This constructor was deprecated
in API level 14.
Use SslError(int, X509Certificate, String)
Creates a new SslError object using the supplied error and certificate. The URL will be set to the empty string.
Parameters | |
---|---|
error |
int :
The SSL error |
certificate |
X509Certificate :
The associated SSL certificate |
SslError (int error, SslCertificate certificate, String url)
Creates a new SslError object using the supplied error, certificate and URL.
Parameters | |
---|---|
error |
int :
The SSL error |
certificate |
SslCertificate :
The associated SSL certificate |
url |
String :
The associated URL
|
SslError (int error, X509Certificate certificate, String url)
Creates a new SslError object using the supplied error, certificate and URL.
Parameters | |
---|---|
error |
int :
The SSL error |
certificate |
X509Certificate :
The associated SSL certificate |
url |
String :
The associated URL
|
boolean addError (int error)
Adds the supplied SSL error to the set.
Parameters | |
---|---|
error |
int :
The SSL error to add |
Returns | |
---|---|
boolean |
True if the error being added is a known SSL error, otherwise false. |
SslCertificate getCertificate ()
Gets the SSL certificate associated with this object.
Returns | |
---|---|
SslCertificate |
The SSL certificate, non-null. |
int getPrimaryError ()
Gets the most severe SSL error in this object's set of errors. Returns -1 if the set is empty.
Returns | |
---|---|
int |
The most severe SSL error, or -1 if the set is empty. |
String getUrl ()
Gets the URL associated with this object.
Returns | |
---|---|
String |
The URL, non-null. |
boolean hasError (int error)
Determines whether this object includes the supplied error.
Parameters | |
---|---|
error |
int :
The SSL error to check for |
Returns | |
---|---|
boolean |
True if this object includes the error, otherwise false. |
String toString ()
Returns a string representation of this object.
Returns | |
---|---|
String |
A String representation of this object. |