禁用本地主机服务器的信任评估会增加安全性问题

时间:2018-06-26 08:21:26

标签: ios alamofire

我正在为本地主机服务器禁用信任评估。 此配置是否会在发行版中添加任何安全性问题?

private static var manager: Alamofire.SessionManager = {

    // Create the server trust policies
    let serverTrustPolicies: [String: ServerTrustPolicy] = [
        "localhost": .disableEvaluation
    ]

    // Create custom manager
    let configuration = URLSessionConfiguration.default
    configuration.httpAdditionalHeaders = Alamofire.SessionManager.defaultHTTPHeaders
    let manager = Alamofire.SessionManager(
        configuration: URLSessionConfiguration.default,
        serverTrustPolicyManager: ServerTrustPolicyManager(policies: serverTrustPolicies)
    )

    return manager
}()

谢谢

0 个答案:

没有答案