Skip to content

Instantly share code, notes, and snippets.

@below
Last active August 29, 2015 14:02
Show Gist options
  • Save below/b862564fb24dd07d0c87 to your computer and use it in GitHub Desktop.
Save below/b862564fb24dd07d0c87 to your computer and use it in GitHub Desktop.
var trust : Unmanaged<SecTrust>?
let status : OSStatus = SecTrustCreateWithCertificates(nil, nil, &trust)
let certificate = SecTrustGetCertificateAtIndex(trust?.takeUnretainedValue(), 0)
let serverCertData = SecCertificateCopyData(certificate).takeUnretainedValue()
/*
error: cannot convert the expression's type 'CFData' to type '$T6'
let serverCertData = SecCertificateCopyData(certificate).takeUnretainedValue()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment