Added in API level 8

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: X509Certificate!)

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!, url: String!)

Creates a new SslError object using the supplied error, certificate and URL.

Public methods
open Boolean
addError(error: Int)

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!

Gets the URL associated with this object.

open Boolean
hasError(error: Int)

Determines whether this object includes the supplied error.

open String

Returns a string representation of this object.

Constants

SSL_DATE_INVALID

Added in API level 14
static val SSL_DATE_INVALID: Int

The date of the certificate is invalid

Value: 4

SSL_EXPIRED

Added in API level 8
static val SSL_EXPIRED: Int

The certificate has expired

Value: 1

SSL_IDMISMATCH

Added in API level 8
static val SSL_IDMISMATCH: Int

Hostname mismatch

Value: 2

SSL_INVALID

Added in API level 14
static val SSL_INVALID: Int

A generic error occurred

Value: 5

SSL_MAX_ERROR

Added in API level 8
Deprecated in API level 15
static val SSL_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

Added in API level 8
static val SSL_NOTYETVALID: Int

The certificate is not yet valid

Value: 0

SSL_UNTRUSTED

Added in API level 8
static val SSL_UNTRUSTED: Int

The certificate authority is not trusted

Value: 3

Public constructors

SslError

Added in API level 8
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

Added in API level 8
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

Added in API level 14
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

Added in API level 14
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

Added in API level 8
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

Added in API level 8
open fun getCertificate(): SslCertificate!

Gets the SSL certificate associated with this object.

Return
SslCertificate! The SSL certificate, non-null.

getPrimaryError

Added in API level 8
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

Added in API level 14
open fun getUrl(): String!

Gets the URL associated with this object.

Return
String! The URL, non-null.

hasError

Added in API level 8
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

Added in API level 8
open fun toString(): String

Returns a string representation of this object.

Return
String A String representation of this object.