Skip to content

Use Xcode 8 to open the project as the following error:"Use of unresolved identifier 'kSecTrustResultInvalid' " #1541

@RamboLouis

Description

@RamboLouis

fd774a26-2c00-4b13-b3ba-711a64bc47d2
Alamofire/Source/ServerTrustPolicy.swift:243:41: Use of unresolved identifier 'kSecTrustResultInvalid'

Activity

changed the title [-]Use Xcode 8 to open the project as the following error:""[/-] [+]Use Xcode 8 to open the project as the following error:"Use of unresolved identifier 'kSecTrustResultInvalid' "[/+] on Sep 15, 2016
RebeccaB89

RebeccaB89 commented on Sep 15, 2016

@RebeccaB89

Update your library,

updated now and in ServerTrustPolicy file i can see:

`
private func trustIsValid(_ trust: SecTrust) -> Bool {
var isValid = false

    var result = SecTrustResultType.invalid
    let status = SecTrustEvaluate(trust, &result)

    if status == errSecSuccess {
        let unspecified = SecTrustResultType.unspecified
        let proceed = SecTrustResultType.proceed


        isValid = result == unspecified || result == proceed
    }

    return isValid
}

`

jshier

jshier commented on Sep 15, 2016

@jshier
Contributor

Please ensure you are using the appropriate version of Xcode for the version of Alamofire you're trying to use. Alamofire 4 requires Xcode 8, Alamofire 3.5 is compatible with both Xcode 7.3 and Xcode 8 with the "Use legacy Swift version" setting set to true.

self-assigned this
on Sep 15, 2016
mythical-programmer

mythical-programmer commented on Oct 17, 2016

@mythical-programmer

I am using Appropriate version. I tried Alamofire 3.1.4, 3.5.0, 3.5.1 with Xcode 8. Use Legacy swift version = YES. Still unresolved identifier error is appearing !
Any other solution ?

KiranJasvanee

KiranJasvanee commented on Oct 20, 2016

@KiranJasvanee

Try Below Code. This worked for me. You've to capitalised enum type for swift 2.3 and Smaller for 3.0

var result = SecTrustResultType.Invalid
let status = SecTrustEvaluate(trust, &result)

if status == errSecSuccess {
       let unspecified = SecTrustResultType.Unspecified
       let proceed = SecTrustResultType.Proceed


       isValid = result == unspecified || result == proceed
}

return isValid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @jshier@KiranJasvanee@RebeccaB89@mythical-programmer@RamboLouis

      Issue actions

        Use Xcode 8 to open the project as the following error:"Use of unresolved identifier 'kSecTrustResultInvalid' " · Issue #1541 · Alamofire/Alamofire