Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
RamboLouis opened this issue Sep 15, 2016 · 4 comments
Assignees
Labels

Comments

@RamboLouis
Copy link

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

@RamboLouis RamboLouis 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' " Sep 15, 2016
@RebeccaB89
Copy link

RebeccaB89 commented Sep 15, 2016

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
Copy link
Contributor

jshier commented Sep 15, 2016

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.

@jshier jshier closed this as completed Sep 15, 2016
@jshier jshier added the support label Sep 15, 2016
@jshier jshier self-assigned this Sep 15, 2016
@mythical-programmer
Copy link

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
Copy link

KiranJasvanee commented Oct 20, 2016

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
Labels
Projects
None yet
Development

No branches or pull requests

5 participants