Back to Alamofire

DefaultTrustEvaluator

docs/docsets/Alamofire.docset/Contents/Resources/Documents/Classes/DefaultTrustEvaluator.html

5.12.0935 B
Original Source

DefaultTrustEvaluator

public final class DefaultTrustEvaluator : ServerTrustEvaluating

An evaluator which uses the default server trust evaluation while allowing you to control whether to validate the host provided by the challenge. Applications are encouraged to always validate the host in production environments to guarantee the validity of the server’s certificate chain.

`

                init(validateHost:)
                `

Creates a DefaultTrustEvaluator.

Declaration

Swift

public init(validateHost: Bool = true)

Parameters

| validateHost |

Determines whether or not the evaluator should validate the host. true by default.

|

`

                evaluate(_:forHost:)
                `

Declaration

Swift

public func evaluate(_ trust: SecTrust, forHost host: String) throws