MtlsClientBuilder

Builder for OkHttpClient with mutual TLS (mTLS) support.

Configures the HTTP client to present a client certificate during TLS handshake, enabling two-way authentication where both the client and server verify each other's identity.

Usage:

val client = MtlsClientBuilder.build(
baseClient = existingClient,
mtlsConfig = MtlsConfig(provider),
)

Functions

Link copied to clipboard
fun build(baseClient: OkHttpClient, mtlsConfig: MtlsConfig): OkHttpClient

Build an OkHttpClient configured for mutual TLS.

Link copied to clipboard
fun fromPolicy(baseClient: OkHttpClient, policy: TransportSecurityPolicy): OkHttpClient

Create an mTLS-enabled OkHttpClient from a TransportSecurityPolicy.