OpenSSL | iOS

64ビットのiOSデバイスにOpenSSLをインストールするには、libcrypto.a と libssl.a のSSLライブラリファイルをシステムにコピーする必要があります。iOS OpenSSLの .zip をダウンロードし、解凍して \lib ディレクトリ内の .a ファイルを見つけます。libcrypto.a と libssl.a のSSLライブラリファイルを以下のディレクトリにコピーする必要があります:

 

 

sgcIdSSLOpenSSLHeaders_static(sgcWebSocketsのエディションがEnterpriseでない場合はIdSSLOpenSSLHeaders_static) ユニットをuses句に追加します。

 

任意のファイルをデプロイする必要がある場合は、RemotePath = StartUp\Documents に設定し、ファイルを読み込むには以下を使用します(uses 句に System.IOUtils を追加する必要があります):

 

TPath.GetDocumentsPath + PathDelim + <your filename>

 

openSSLライブラリは、iOSではメニューProject/Deploymentを使用してデプロイしてはなりません。

 

API 1.1

IdCompilerDefines.inc を変更し、IOSセクションでSGC_OPENSSL_API_1_1を有効にします:

 

{$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

// プロジェクトに静的 OpenSSL ライブラリを追加し、以下を include する

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

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

{$DEFINE STATICLOAD_OPENSSL}

// sgc--> openssl API 1.1向けに有効化

{$DEFINE SGC_OPENSSL_API_1_1}

{$ENDIF}

{$ENDIF}

 

アカウントからライブラリをダウンロードできます。

 

 

API 3.0

IdCompilerDefines.inc を変更して、IOS セクションで SGC_OPENSSL_API_1_1 と SGC_OPENSSL_API_3_0 を有効にしてください:

 

{$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

// プロジェクトに静的 OpenSSL ライブラリを追加し、以下を include する

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

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

{$DEFINE STATICLOAD_OPENSSL}

// sgc--> 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}

 

アカウントからライブラリをダウンロードできます。