SslError
open class SslError
kotlin.Any | |
↳ | android.net.http.SslError |
This class represents a set of one or more SSL errors and the associated SSL certificate.
Summary
Constants | |
---|---|
static Int |
The date of the certificate is invalid |
static Int |
The certificate has expired |
static Int |
Hostname mismatch |
static Int |
A generic error occurred |
static Int |
The number of different SSL errors. |
static Int |
The certificate is not yet valid |
static Int |
The certificate authority is not trusted |
Public constructors | |
---|---|
SslError(error: Int, certificate: SslCertificate!) Creates a new SslError object using the supplied error and certificate. |
|
SslError(error: Int, certificate: SslCertificate!, url: String!) Creates a new SslError object using the supplied error, certificate and URL. |
|
SslError(error: Int, certificate: X509Certificate!) Creates a new SslError object using the supplied error and certificate. |
|
SslError(error: Int, certificate: X509Certificate!, url: String!) Creates a new SslError object using the supplied error, certificate and URL. |
Public methods | |
---|---|
open Boolean |
Adds the supplied SSL error to the set. |
open SslCertificate! |
Gets the SSL certificate associated with this object. |
open Int |
Gets the most severe SSL error in this object's set of errors. |
open String! |
getUrl() Gets the URL associated with this object. |
open Boolean |
Determines whether this object includes the supplied error. |
open String |
toString() Returns a string representation of this object. |
Constants
SSL_DATE_INVALID
static val SSL_DATE_INVALID: Int
The date of the certificate is invalid
Value: 4
SSL_MAX_ERROR
static valSSL_MAX_ERROR: Int
Deprecated: This constant is not necessary for using the SslError API and can change from release to release.
The number of different SSL errors.
Value: 6
SSL_NOTYETVALID
static val SSL_NOTYETVALID: Int
The certificate is not yet valid
Value: 0
SSL_UNTRUSTED
static val SSL_UNTRUSTED: Int
The certificate authority is not trusted
Value: 3
Public constructors
SslError
SslError(
error: Int,
certificate: SslCertificate!)
Deprecated: Use SslError(int,android.net.http.SslCertificate,java.lang.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
SslError(
error: Int,
certificate: SslCertificate!,
url: String!)
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
SslError(
error: Int,
certificate: X509Certificate!)
Deprecated: Use SslError(int,java.security.cert.X509Certificate,java.lang.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
SslError(
error: Int,
certificate: X509Certificate!,
url: String!)
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 |
Public methods
addError
open fun addError(error: Int): Boolean
Adds the supplied SSL error to the set.
Parameters | |
---|---|
error |
Int: The SSL error to add |
Return | |
---|---|
Boolean |
True if the error being added is a known SSL error, otherwise false. |
getCertificate
open fun getCertificate(): SslCertificate!
Gets the SSL certificate associated with this object.
Return | |
---|---|
SslCertificate! |
The SSL certificate, non-null. |
getPrimaryError
open fun getPrimaryError(): Int
Gets the most severe SSL error in this object's set of errors. Returns -1 if the set is empty.
Return | |
---|---|
Int |
The most severe SSL error, or -1 if the set is empty. |
getUrl
open fun getUrl(): String!
Gets the URL associated with this object.
Return | |
---|---|
String! |
The URL, non-null. |
hasError
open fun hasError(error: Int): Boolean
Determines whether this object includes the supplied error.
Parameters | |
---|---|
error |
Int: The SSL error to check for |
Return | |
---|---|
Boolean |
True if this object includes the error, otherwise false. |
toString
open fun toString(): String
Returns a string representation of this object.
Return | |
---|---|
String |
A String representation of this object. |