CertificatePinner
A certificate-pinning hook for KtorTlsConnector: a check of the server's chain on top of TlsTrust, never instead of it. It runs during the TLS handshake, after the chain was validated against the trust anchors and found to name the server, and before any CoAP message is sent; refusing ends the handshake.
val pins = CertificatePinner.publicKeySha256(listOf(Base64.decode("47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")))
val connector = KtorTlsConnector(TlsClientConfig(pinner = pins))Content copied to clipboard
Functions
Link copied to clipboard
Whether to accept chain for host. host is the peer's host as the request named it, an IP literal in canonical form or a lower-case name. chain is the validated path, end-entity certificate first, then each issuer up to and including the trust anchor that vouched for it. Throwing refuses the connection as well.