open class ServerTrustPolicyManager
Responsible for managing the mapping of
ServerTrustPolicy objects to a given host.
ServerTrustPolicyManagerinstance with the given policies.
Since different servers and web services can have different leaf certificates, intermediate and even root certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key pinning for host3 and disabling evaluation for host4.
public init(policies: [String: ServerTrustPolicy])
ServerTrustPolicyfor the given host if applicable.
By default, this method will return the policy that perfectly matches the given host. Subclasses could override this method and implement more complex mapping implementations such as wildcards.
open func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy?