Olivier Sannier wrote:
Roy Lambert wrote:
Olivier
If correct that's weirder because I've placed those in the application directory.
Well, in my case, the DLLs were required by another DLL that was placed
with them in a directory that is not the one from the exe. So I had to
to this
procedure SetupOpenSSLDLLName;
var
ModulePath: string;
begin
ModulePath :=
ExcludeTrailingPathDelimiter(ExtractFilePath(GetModuleName(HInstance)));
if ModulePath <> '' then
begin
// use the OpenSSL DLLs from the itdownload.dll path instead of the
ones from system folders
SetDllDirectory(PChar(ModulePath));
DestroySSLInterface;
end;
end;
The part about destroying the SSL instance is important because without
this it would not use those from the folder where the DLL is located
Oh, and I had to repeat the initialization part, so basically, in the
above code, add these two lines after DestroySSLInterface:
if InitSSLInterface then
SSLImplementation := TSSLOpenSSL;
Without this, the global variable may not be set and this is what
triggers the error message you are seeing.
And finally, this was not working in my particular case because the
above code was called before the OpenSSL dlls were created on disk,
which was an error on my side.
Connect with Us