7

I am learning how to add in-app purchase receipt validation to my iOS/OSX projects.

There is a nice overview here and the WWDC14 has good videos on this topic.

Plenty of sample code, but everyone skips one step. How to import the openSSL header. The swift compiler complains that there is no such module.

import Foundation
import StoreKit
import openssl  //no such module ???

I am already stuck before writing one line of code. Where is the openssl framework hiding?

1

1 Answer 1

4

There is no OpenSSL module built in. You have to compile it yourself - this is for security so that everyone doesn't implement the exact same security.

Take a look at : https://gist.github.com/foozmeat/5154962 http://www.cvursache.com/2013/08/13/How-To-Build-openssl-For-iOS/

There is a also a cocoapods at http://cocoapods.org/?q=openssl

You should never use a static module provided by someone else. Always build your own.

Apples official explanation here - under OpenSSl - https://developer.apple.com/library/ios/documentation/Security/Conceptual/cryptoservices/GeneralPurposeCrypto/GeneralPurposeCrypto.html

7
  • This script worked for me. github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
    – user965972
    Jul 13, 2015 at 16:24
  • I am facing problem in configured openssl in swift project. Please suggest it , How to configured openssl in swift.
    – Vipulk617
    Oct 14, 2015 at 6:13
  • @user965972 can you send demo application openssl with swift.
    – Vipulk617
    Oct 14, 2015 at 12:43
  • @vipulk617 No, sorry. I learned that the reason there is no standard module is due to security reasons. Everyone should make their own module to reduce the risk of a security breach. Just look at what Dave posted. You can use that to figure out how to build you own.
    – user965972
    Oct 15, 2015 at 11:20
  • @user965972 I just want to access private content from cloud front using following link forums.aws.amazon.com/thread.jspa?messageID=336955 But not able to use openssl in swift . I just want to know , How to only integrate openssl library in swift not write any code because i tried this library in swift but getting error.
    – Vipulk617
    Oct 15, 2015 at 11:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.