Synapse(Release 40, 2012-04-23) + FPC(3.2.2) TOpenSSLSocketHandler + OpenSSL 3 lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- tsknv · 2024-03-15 03:47 Hello. Synapse not working with OpenSSL library version 1.1 and version 3 (libssl-1_1.dll, libcrypto-1_1.dll, libssl-3.dll, libcrypto-3.dll). Set variables "DLLSSLName" and "DLLUtilName" in "ssl_openssl_lib.pas" to files library OpenSSL version 1.1 or 3 files causes encryption to fail. Attached unit implement FPC class TOpenSSLSocketHandler to Synapse TCustomSSL class. OpenSSL library files sets variables "DLLSSLName" and "DLLUtilName" in FPC "openssl.pas" unit. Using: Copy file "FPSynapseOpenSSL.pas" to "\source\lib\" directory  in Synapse folder. Add FPSynapseOpenSSL unit to "uses" clause in Synapse unit "ssl_openssl.pas" In Synapse unit "ssl_openssl.pas" "initialization" section replace "SSLImplementation := TSSLOpenSSL;" to "SSLImplementation := FPSynapseOpenSSL.TFPSynapseOpenSSL;" p.s. class TFPSynapseOpenSSL allows you to work Synapse with libraries OpenSSL vewrsion 1.1 and 3 ---------------------------------------------------------------------- Thaddy · 2024-03-15 05:33 Synapse is at version 4.1, not 4.0 And what is the problem you are solving? fcl-net is related to synapse, certainly the openssl part and already supports openssl 1.1 and 3.0. And is better maintained. With respect: I don't see the point and the installation instructions look clumsy. ---------------------------------------------------------------------- paweld · 2024-03-15 06:44 Synapse has long supported ssl 1.1 and 3.0. Current sources are on github: https://github.com/geby/synapse ---------------------------------------------------------------------- rvk · 2024-03-15 07:29 QuoteSynapse is at version 4.1, not 4.0 Small correction... 40.1 (or trunk). I don't think Synapse has a official numbered release. But it was 40.1 for trunk on SourceForge (before moving to github). On the official github it doesn't seem to have a number... ( = trunk ) Version 40.1 is also on OPM (not latest trunk) There are a lot of version floating out there. But Release 40 (2012-04-23) is definitely not the one you want (too old). So either 1) use fcl-net (like Thaddy suggested). 2) use the 40.1 from OPM (although I don't know the state of OpenSSL 3.0 in that one) 3) use the one on official github ---------------------------------------------------------------------- tsknv · 2024-03-15 08:55 I have a old project using Synapse 40... I wanted, without changing the project code, without changing the Synapse version, to add OpenSSL 3 support to the project, nothing more. ---------------------------------------------------------------------- rvk · 2024-03-15 09:00 Quote from: tsknv on March 15, 2024, 09:55:17 amI have a old project using Synapse 40... I wanted, without changing the project code, without changing the Synapse version, to add OpenSSL 3 support to the project, nothing more. Not possible, unless you want to code the OpenSSL 3 code in Synapse yourself and add it to your old version 40. And even with the newer version, you would need to include ssl_openssl3 instead of ssl_openssl. But with the new code you get a hint: "Use ssl_openssl3 with OpenSSL 3.0 instead" when you use the older ssl_openssl for 1.0/1.1. (Although I do see the libssl-3-x64.dll inside ssl_openssl_lib.pas so it might work without changing to ssl_openssl3 in uses) ---------------------------------------------------------------------- tsknv · 2024-03-15 11:01 libcrypto-3.dll/libssl-3.dll implement only OpenSSL 3? or also versions 1 and 1.1? p.s. maybe I don't understand something ---------------------------------------------------------------------- rvk · 2024-03-15 11:04 Quote from: tsknv on March 15, 2024, 12:01:45 pmlibcrypto-3.dll/libssl-3.dll implement only OpenSSL 3? or also versions 1 and 1.1? Only OpenSSL 3. But the code there checks if older versions of the dll are present (if 3 isn't) and loads them. ---------------------------------------------------------------------- tsknv · 2024-03-16 01:48 This allows me to use in my old project libcrypto-3.dll/libssl-3.dll instead of libeay32.dll/ssleay32.dll . To load OpenSSL 3 libraries, must change the variables of "DLLSSLName" and "DLLUtilName" in the FPC module "openssl.pas" before dynamically loading OpenSSL libraries (see Function LoadLibraries in openssl.pas) on "libssl-3.dll " and "libcrypto-3.dll ". For example, in the initialization section of one of the modules of my project: AppPath: = ExtractFilePath(application.ExeName); openssl.DLLSSLName:= AppPath + 'libssl-3.dll'; openssl.DLLUtilName:= AppPath + 'libcrypto-3.dll';