By Default Indy defines the most common openssl functions needed to encrypt the communications, but sometimes you need more functions for encryption, signing... From sgcIndy 2025.3.0 you can use the new method IdOpenSSLSetLoadFuncsCallback to assign a callback for loading additional OpenSSL functions dynamically.
TIdLoadSSLFuncsCallback = procedure(hIdSSL: TIdLibHandle; hIdCrypto: TIdLibHandle; const FailedLoadList: TStringList);
This is a procedure type that serves as a callback, it takes three parameters:
The purpose of this callback is to allow the user to perform custom processing when OpenSSL functions are being loaded, such as logging failed function loads or handling errors.
TIdUnLoadSSLFuncsCallback = procedure();
It serves as a callback for unloading SSL functions.This is useful for performing cleanup when OpenSSL libraries are being unloaded.
Find below a simple example of how to load the function EVP_PKEY_CTX_set_rsa_padding using the callbacks.
var EVP_PKEY_CTX_set_rsa_padding : function(ctx: PEVP_PKEY_CTX; pad: Integer): Integer; cdecl; procedure DoOpenSSLLoadFuncsCallback(hIdSSL: TIdLibHandle; hIdCrypto: TIdLibHandle; const FailedLoadList: TStringList); begin @EVP_PKEY_CTX_set_rsa_padding := LoadLibFunction(hIdCrypto, 'EVP_PKEY_CTX_set_rsa_padding'); end; procedure DoOpenSSLUnLoadFuncsCallback; begin @EVP_PKEY_CTX_set_rsa_padding := nil; end; IdOpenSSLSetLoadFuncsCallback(DoOpenSSLLoadFuncsCallback); IdOpenSSLSetUnLoadFuncsCallback(DoOpenSSLUnLoadFuncsCallback);
Enter your text here ...
Find below a delphi demo showing how to load a custom openssl function using sgcIndy 2025.3.0+
When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.