CustomCertManager

class CustomCertManager @JvmOverloads constructor(context: Context, val trustSystemCerts: Boolean = true, var appInForeground: StateFlow<Boolean>?) : X509TrustManager

TrustManager to handle custom certificates.

Initializes Conscrypt when it is first loaded.

Parameters

trustSystemCerts

whether system certificates will be trusted

appInForeground
  • true: if needed, directly launches TrustCertificateActivity and shows notification (if possible)

    • false: if needed, shows notification (if possible)

    • null: non-interactive mode: does not show notification or launch activity

Constructors

Link copied to clipboard
constructor(context: Context, trustSystemCerts: Boolean = true, appInForeground: StateFlow<Boolean>?)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
inner class HostnameVerifier(defaultHostnameVerifier: HostnameVerifier? = null) : HostnameVerifier

A HostnameVerifier that allows users to explicitly accept untrusted and non-matching (bad hostname) certificates.

Properties

Link copied to clipboard
var appInForeground: StateFlow<Boolean>?
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun checkClientTrusted(chain: Array<X509Certificate>?, authType: String?)
Link copied to clipboard
open override fun checkServerTrusted(chain: Array<X509Certificate>, authType: String)

Checks whether a certificate is trusted. Allows user to explicitly accept untrusted certificates.

Link copied to clipboard