fromPolicy

fun fromPolicy(baseClient: OkHttpClient, policy: TransportSecurityPolicy): OkHttpClient

Create an mTLS-enabled OkHttpClient from a TransportSecurityPolicy.

Return

A new client configured for mTLS if policy has mTLS config, otherwise returns the base client.

Parameters

baseClient

The base client to configure.

policy

The transport security policy.