Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272
info@synaptica.info

Delphi Support OpenSSL and HTTPS for iOS Devices

Digital solution partner

Delphi Support OpenSSL and HTTPS for iOS Devices

Since 2014, it’s been possible to compile applications with Delphi for the iOS world and integrate the Indy library for TCP/IP communication with SSL encryption thanks to OpenSSL, as documented on Embarcadero’s website at the following link https://blogs.embarcadero.com/openssl-and-https-support-for-ios-devices/.

This can be done by including the “IdSSLOpenSSLHeaders_Static.pas” library in your project and copying the compiled libraries libssl.a and libcrypto.a. These libraries are compiled within your project, as it is challenging to use dynamically linked libraries on iOS. At this point, you can use your SSL “handlers” as you are accustomed to doing for your clients or servers on other platforms.

The fact that the libssl.a and libcrypto.a libraries are linked within the final executable of your project implies that if these libraries do not have a header compatible with what the “IdSSLOpenSSLHeaders_Static.pas” unit expects during the project’s linking phase, you might encounter a linking error.

A now classic linking error for these libraries is:

“https://en.delphipraxis.net/topic/3563-ios-libcryptoa-libssla/#:~:text=Error 22_SSL_COMP_free_compression_methods referenced from__ZN26Idsslopensslheaders_static38SSL_COMP_free_compression_methods_funcEv in IdSSLOpenSSLHeaders_static.o symbol(s) not found for architecture arm64”

This implies that you need to recompile the libraries in question for the current version of SSL supported by Indy. With Delphi 12, I conveniently used the already compiled libraries within the open-source library “Kastri“: