You are not logged in.
Hi everyone,
I’m running this code in a Lazarus project on macOS, but I keep getting SSL-related errors. It runs fine on Windows and Linux by just adding "mormot.lib.openssl11" in the uses clause, but on macOS, I still get these errors. Doesn’t mORMot use cURL? Why does it need SSL? How can I fix this? Any help would be appreciated!
I have tried to install openssl on my Mac but the issues persist. Any insights on how to resolve this would be greatly appreciated!
These are the errors I get on macOS:
1) [Debugger Exception Notification] [Break]: Project raised exception class 'EOpenSsl' with message: TLibCrypto.TryLoadLibray failed
2: [Debugger Exception Notification] Project raised exception class 'ENetSock' with message: THttpClientSocket.DoTlsAfter: TLS failed [ENetSock THttpClientSocket.DoTlsAfter: TLS is not available on this system - try installing OpenSSL 1.1/3.x]
Here's the relevant code snippet:
https://gist.github.com/synopse/40f0440 … f9b8ee6e60
Offline
1) Please follow the forum rules and do not put extensive code or log output in the forum threads.
2) There is no built-in OpenSSL library in MacOS.
You need to use your own OpenSSL dylib, and specify its location to the unit.
Offline
Thanks for your response, I didn't know I shouldn't include code in my questions, I am sorry for that. Do I need to use openssl in my Mac version of this project?
Isn't there another way to use the same function and client but not the openssl?
Thanks in advance for any help
Offline
I have put the latest OpenSSL 3.1.6 dylib we use with our product WAPT on Mac OS x86_64 to download.
It has been built directly from official sources.
From https://synopse.info/files/OpenSSLMacX64.tgz
You have to
- put those two .dylib files with your executable,
- (optional, try it if it fails) then properly set OpenSslDefaultCrypto and OpenSslDefaultSsl global variables to point to them,
- then mormot.lib.openssl should be able to find and load them.
Offline
Thank you so much, now it works perfectly fine, without even applying the second step which was:
- (optional, try it if it fails) then properly set OpenSslDefaultCrypto and OpenSslDefaultSsl global variables to point to them,
Offline
In some other part of my project I am using "MainHttpClass" function in mormot.net.client file, and it works fine in mac for my network communications without openssl, and I have a custom setting for my project set in my compiler options additions and overrides, stored in my lpi file like this:
-Scghi -CX -XX -l -vewnhibq -dX_RELEASE -dUSELIBCURL
now I need to use the "THttpClientSocket" client to use its "WGet" function as it fulfills my needs, but because the openssl libs you mentioned have big sizes, I need to know if there is a way to use libcurl instead of openssl in all the platforms for this client as well, is this possible in current mormot? and if it is possible how can I implement it?
thanks for your help.
Offline