makeSSLSocketFactory

Creates an SSLSocketFactory bound to this TrustPin instance.

The returned factory performs TrustPin certificate pinning validation on every TLS connection. Use with OkHttp or HttpsURLConnection:

val pin = TrustPin.default
val client = OkHttpClient.Builder()
.sslSocketFactory(pin.makeSSLSocketFactory(), pin.makeTrustManager())
.build()

Return

A new SSLSocketFactory with TrustPin validation

Throws

if the platform's TLS stack cannot be configured for pinning (JCE/JSSE failure — environmental, not a TrustPin policy decision).

if the SDK refuses to operate because the runtime environment is not a supported production Android device. Hosts that need the coarse outcome can match the TrustPinError supertype to catch both.