#1 2024-08-07 15:02:33

sayencrusher
Member
Registered: 2024-07-31
Posts: 7

SSL Errors on macOS with mORMot2 in Lazarus Project

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

#2 2024-08-07 17:03:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: SSL Errors on macOS with mORMot2 in Lazarus Project

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

#3 2024-08-08 07:29:05

sayencrusher
Member
Registered: 2024-07-31
Posts: 7

Re: SSL Errors on macOS with mORMot2 in Lazarus Project

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

#4 2024-08-08 09:47:14

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: SSL Errors on macOS with mORMot2 in Lazarus Project

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

#5 2024-08-08 13:57:28

sayencrusher
Member
Registered: 2024-07-31
Posts: 7

Re: SSL Errors on macOS with mORMot2 in Lazarus Project

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

#6 2024-08-12 09:21:31

sayencrusher
Member
Registered: 2024-07-31
Posts: 7

Re: SSL Errors on macOS with mORMot2 in Lazarus Project

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

#7 2024-08-12 14:25:35

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,548
Website

Re: SSL Errors on macOS with mORMot2 in Lazarus Project

I am not sure we did validate libcurl on Mac.

Is libcurl available natively? I doubt it very much.

Offline

Board footer

Powered by FluxBB