Over the last few days I've been updating the lNet (Lightweight Networking Library) to compile and run successfully on FreeBSD, macOS and Windows using FPC 3.2.2 or FPC 3.3.1. It now does. macOS happily uses TLS 1.3 (thanks to MIA Forum user Tz) for SMTP; FreeBSD happily uses TLS 1.2 for SMTP; and Windows 32 and 64 bit happily use TLS 1.2 for SMTP.
I should mention that I've only thoroughly tested the SMTP protocol which was the itch I wanted to scratch because macOS has no framework for SMTP at all and so a third-party library was required.
I have added the Lazarus SMTP client example to the Wiki
here.
The updated lNet library is on GitHub
here.
Alas, my Linux (Ubuntu 20.10) attempts met with a little less success. If I comment out the TLS handshake (FSMTP.StartTLS;) , the SMTP transaction flies through with no problems. If I leave the TLS handshake in, it succeeds but then the application locks up with the error:
Error on epoll [4]: Interrupted system call
which comes from the Linux only file
lib/sys/lepolleventer.inc and never sends the email to my FreeBSD sendmail server which waits patiently to no avail.
I very rarely ever use any Linux and I'll happily concede that I know nothing about its workings. My searching threw up a few similar epoll issues but did not enlighten me sufficiently to come up with a fix.
So, if anyone feels like trying to tame the beast, you'll need to change the only
FreeBSD ifdef in
lib/lnetssl.pp to Linux because Linux, like FreeBSD, always seems to want to use SSL 2/3 rather than TLS 1.x and fails, so I force it to use TLS 1.2. macOS happily picks TLS 1.3 all by itself.
Have fun :-)
[Updated to add Windows]