Appmethod Tip: OpenSSL and HTTPS Support for iOS Devices

Posted by on in Tutorial

Appmethod uses OpenSSL for HTTPS support. If your iOS application requires OpenSSL support you must configure your project to include the required libraries: libcrypto and libssl. This blog post has the quick few steps to ensure your iOS application has OpenSSL and HTTPS support.

 

 

For the iOS Device target platform, which does not support dynamic libraries, you need a static version of these library files (libcrypto.a and libssl.a). To obtain these library files, do either of the following:

 

  1. Download the pre-compiled libraries from Github.

  2. Build these libraries from sources. Download the sources from Github and follow the steps described in Tutorial: Script for Building OpenSSL for iOS (iPhone/iPad) to compile these libraries.

 

After you have these library files, copy them into a folder where your project searches for libraries, such as the main project folder.

 

Next, the Appmethod IDE needs to be configured so your project can link with lib crypto and libssl. Select Project > Options > C++ Linker, and set "Link with SSL and Crypto" to True.

Cpp-Linker-iOS_1

Lastly, in your project code, include the static header with a #if defined to ensure the file is only included when deploying to an iOS device.

#if defined(TARGET_OS_IPHONE)
    #include <IdSSLOpenSSLHeaders_Static.hpp>
#endif

For more information on deploying iOS applications, please refrence the Appmethod Doc Wiki: Creating an iOS App.

Tags: Appmethod


About
Gold User, Rank: 8, Points: 399
Brian Alexakis is a Product Marketing Manager at Embarcadero Technologies. He is focused on leveraging the connected world of technology to build new experiences for the Internet of Things.

Comments

Check out more tips and tricks in this development video: