okhttp / okhttp3 / CertificatePinner / check

check

fun check(hostname:String, peerCertificates:List<Certificate>):Unit

Confirms that at least one of the certificates pinned for hostname is in peerCertificates. Does nothing if there are no certificates pinned for hostname. OkHttp calls this after a successful TLS handshake, but before the connection is used.

Exceptions

SSLPeerUnverifiedException - if peerCertificates don’t match the certificates pinned for hostname.