OpenSSL | iOS

To install OpenSSL in a 64-bit iOS device, you must copy the libcrypto.a and libssl.a SSL library files to your system. Download the .zip iOS OpenSSL, extract it and find the .a files in the \lib directory. You must copy the libcrypto.a and libssl.a SSL library files to these directories:

 

 

Add sgcIdSSLOpenSSLHeaders_static (or IdSSLOpenSSLHeaders if your sgcWebSockets edition is not Enterprise) unit to your uses clause.

 

If you need to deploy any file, you can set RemotePath = StartUp\Documents and to load the file use (requires add System.IOUtils to uses clause):

 

TPath.GetDocumentsPath + PathDelim + <your filename>

 

The openSSL libraries must not be deployed using the menu Project/Deployment under iOS.

 

API 1.1

Modify IdCompilerDefines.inc and enable SGC_OPENSSL_API_1_1 in IOS section:

 

{$IFDEF IOS}

  {$DEFINE HAS_getifaddrs}

  {$DEFINE USE_OPENSSL}

  {$IFDEF CPUARM}

    // RLebeau: For iOS devices, OpenSSL cannot be used as an external library,

    // it must be statically linked into the app.  For the iOS simulator, this

    // is not true.  Users who want to use OpenSSL in iOS device apps will need

    // to add the static OpenSSL library to the project and then include the

    // IdSSLOpenSSLHeaders_static unit in their uses clause. It hooks up the

    // statically linked functions for the IdSSLOpenSSLHeaders unit to use...

    {$DEFINE STATICLOAD_OPENSSL}

// sgc--> enable for openssl API 1.1

{$DEFINE SGC_OPENSSL_API_1_1}

  {$ENDIF}

{$ENDIF}

 

You can download libraries from your account.

 

 

API 3.0

Modify IdCompilerDefines.inc and enable SGC_OPENSSL_API_1_1 and SGC_OPENSSL_API_3_0  in IOS section:

 

{$IFDEF IOS}

  {$DEFINE HAS_getifaddrs}

  {$DEFINE USE_OPENSSL}

  {$IFDEF CPUARM}

    // RLebeau: For iOS devices, OpenSSL cannot be used as an external library,

    // it must be statically linked into the app.  For the iOS simulator, this

    // is not true.  Users who want to use OpenSSL in iOS device apps will need

    // to add the static OpenSSL library to the project and then include the

    // IdSSLOpenSSLHeaders_static unit in their uses clause. It hooks up the

    // statically linked functions for the IdSSLOpenSSLHeaders unit to use...

    {$DEFINE STATICLOAD_OPENSSL}

  // sgc--> enable for openssl API 1.1

  {$DEFINE SGC_OPENSSL_API_1_1}

  // sgc--> enable for openssl API 3.0

  {$DEFINE SGC_OPENSSL_API_3_0}

  {$ENDIF}

{$ENDIF}

 

You can download libraries from your account.