How to Implement SSL Pinning in Swift

How to Implement SSL Pinning in Swift

Evaluating trust is a two-step process.

[…]

SecTrustCreateWithCertificates(_:_:_:) creates a trust management object based on the provided certificates and policies.

[…]

If the trust management instance lacks some of the certificates needed to verify the leaf certificate, SecTrustEvaluateWithError(_:_:) searches for certificates:

[…]