Recent

Author Topic: Synapse(Release 40, 2012-04-23) + FPC(3.2.2) TOpenSSLSocketHandler + OpenSSL 3  (Read 1275 times)

tsknv

  • New member
  • *
  • Posts: 9
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
« Last Edit: March 15, 2024, 05:56:07 am by tsknv »

Thaddy

  • Hero Member
  • *****
  • Posts: 14575
  • Sensorship about opinions does not belong here.
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.
bitrate is always calculated like this:sample rate * bitdepth * number of channels.

paweld

  • Hero Member
  • *****
  • Posts: 1028
Synapse has long supported ssl 1.1 and 3.0. Current sources are on github: https://github.com/geby/synapse
Best regards / Pozdrawiam
paweld

rvk

  • Hero Member
  • *****
  • Posts: 6190
Quote
Synapse 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

  • New member
  • *
  • Posts: 9
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

  • Hero Member
  • *****
  • Posts: 6190
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.
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

  • New member
  • *
  • Posts: 9
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
« Last Edit: March 15, 2024, 12:10:00 pm by tsknv »

rvk

  • Hero Member
  • *****
  • Posts: 6190
libcrypto-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

  • New member
  • *
  • Posts: 9
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';
« Last Edit: March 16, 2024, 04:36:05 am by tsknv »

 

TinyPortal © 2005-2018