You are not logged in.
In the current version of mormot2, the OpenSslInitialize function throws an EOpenSsl exception at line 5899 when attempting to load libssl-3.dll. The issue does not occur in the version from March 16.
I'm using Delphi 12.3 with the latest openssl version 3.4.1, downloaded from https://wiki.overbyte.eu/wiki/index.php/ICS_Download. The error appears in both 32-bit and 64-bit builds.
ThreadId=20380
ProcessId=1
ThreadName="Main"
ExceptionMessage="TLibSsl.TryLoadLibray failed - searched in C:\dev\tm\libssl-3.dll [LoadLibrary error [ERROR_PROC_NOT_FOUND] (0x7F)]"
ExceptionName="EOpenSsl"
ExceptionDisplayName="EOpenSsl"
ExceptionAddress=76E7D4F2
FileName=<not available>
LineNumber=<not available>
ExceptionObject=46FBCCF8
Classes=[EOpenSsl,ExceptionWithProps,Exception,TObject]
Last edited by Sebam (2025-03-19 20:17:21)
Offline
I can't reproduce it here.
We have no problem to load the OpenSSL dll with the current version.
Using the one we build ourselves, or the one from https://slproweb.com/products/Win32OpenSSL.html
ERROR_PROC_NOT_FOUND means that LoadLibrary() was not able to load it because there was a missing dependency.
Please try to debug a little more.
How do you setup the search folders?
What is the associated libcrypto-3.dll loaded? Where is it located? That is, what is libcrypto.LibraryPath value before the attempt to load the libssl?
Are you sure they are both correct (for Win32 or Win64)?
Offline
I've downloaded the libraries from https://slproweb.com/products/Win32OpenSSL.html. Currently, I have three DLLs in the application's exe directory: `legacy.dll`, `libcrypto-3.dll`, and `libssl-3.dll`, all version 3.4.1.0 from 2025-02-11. However, the same exception still occurs.
I haven't set any explicit paths in mormot2 to these OpenSSL libraries—maybe that's necessary, but I'm not sure how to configure it. As mentioned previously, the version from March 16 works flawlessly without any issue loading OpenSSL.
Local vars before call to libcrypto.TryLoadLibrary:
https://app.screencast.com/4WRROitn1aini
Local vars right before call to libssl.TryLoadLibrary and the exception:
https://app.screencast.com/1CADtvIP3nGnm
Exception:
https://app.screencast.com/rm3J0sI03uart
Call stack in TryLoadLibrary:
https://app.screencast.com/pFABmtdlodMAQ
What else can i provide?
Offline
I've discovered that calling `OpenSslInitialize` without parameters raises an exception, but providing just the filenames does not result in an exception. Loading `libssl` fails if no filename or a full path to the library is provided, whereas specifying only the filename succeeds.
It seems that in `TryLoadLibrary`, the `LibraryOpen` call fails for `libssl` when given a full path, but succeeds when given just the filename. The previous version from March 16 used the filename-only approach during one of the attempts, which is why it worked correctly.
Offline
I have made a huge refactoring about OpenSSL loading.
OpenSSL is now available by default on Windows. That is, USE_OPENSSL is defined in mormot.defines.inc.
But you still need to call OpenSslInitialize and RegisterOpenSsl for runtime detection and loading.
I tried also to fix the loading issues about "full path" in the library name - which I was not able to reproduce on my side, anyway.
From my tests, the current version of mORMot trunk seems fine with OpenSSL.
Feedback is welcome.
Offline