How can I statically link Indy OpenSLL files? AFAIK only ICS allows this but for some weird reason Indy doesn't. Neither does it provide .obj files? This will allow me to avoid any dependency on the dll's.
OpenSSL is primarily meant to be used dynamically. That allows for easy upgrades when new OpenSSL versions are released. However, OpenSSL can be compiled statically as well, and Indy 10.6.0+ does support linking to OpenSSL statically, but currently only supports that on iOS devices (because Apple does not allow OpenSSL to be linked dynamically). On all other platforms (including the iOS simulator), Indy links to OpenSSL dynamically by default. If you want Indy to link to OpenSSL statically on non-iOS platforms, you will have to set it up manually:
compile/obtain static-link object files for OpenSSL for your target platform(s) (ie, static .a
files for iOS are provided at Indy's OpenSSL-Binaries GitHub repo).
update Indy's IdCompilerDefines.inc
files to define USE_OPENSSL
and STATICLOAD_OPENSSL
for your target platform(s).
add the IdSSLOpenSSLHeaders
and IdSSLOpenSSLHeaders_static
units to your uses
clause.
make sure IdSSLOpenSSLHeaders_static.pas
compiles for your target platform(s) (it is currently designed for iOS, so you may need to tweak it).
The alternative is to not use OpenSSL at all, but use another SSL/TLS library that can be statically linked and is wrapped by a suitable TIdSSLIOHandlerSocketBase
implementation for Indy to use. EldoS SecureBlackbox, for instance, provides such an implementation for its SSL/TLS library. And in the future, Indy is planning on adding a new IOHandler implementation for SChannel on Windows, which does not require distributing DLLs since they are already installed in the OS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With