Could not initialize openssl library? lazarus / 32-Linux ---------------------------------------------------------------------- Espectr0 · 2023-06-10 23:47 Hola, what can go wrong in linux mint, that I get the message "Could not initialize openssl library"... Do I need to configure something special? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  uses opensslsockets;...FHTTPClient.AllowRedirect := True;FHTTPClient.HTTPMethod(FMethod, AURL, FDS, [200]);  openssl is installed. Thanks! ---------------------------------------------------------------------- Thaddy · 2023-06-11 07:58 What protocol are you requesting? It should be TLS1.2 or higher. Usually the OpenSSL version for Mint is up to date and so will refuse anything below TLS1.2 [edit] I just got the same error using fpcupdeluxe on windows 10. While searching for an answer  I discoverd: 1. The current stable of openssl is 3.1 2. This is not yet supported by fpc 3. But openssl 1.1.1u (lts) is supported by fpc. 4. so check in a terminal using: openssl version Also note fpcdupeluxe worked yesterday so currently I am at a loss. Investigating... I have to exactly the same laptops, with slightly differing versions of Windows 10: one works as of today, the one I am using now doesn't. Strange. So it is probably not related to Mint, but the presence of openssl 1.1.1. ---------------------------------------------------------------------- Espectr0 · 2023-06-11 10:55 The version installed is v3.0.2 15 Mar 2022. It is not supported by fpc? ---------------------------------------------------------------------- paweld · 2023-06-11 11:28 fpc trunk only.  or use synapse ---------------------------------------------------------------------- Espectr0 · 2023-06-11 12:10 Thanks ---------------------------------------------------------------------- Thaddy · 2023-06-11 12:45 Quote from: paweld on June 11, 2023, 01:28:14 pmfpc trunk only.  or use synapse Since when does synapse support openssl 3.x? It does not. Also I use mainly trunk (always recent) and trunk also does not support openssl 3.x. It supports the long time support version of openssl 1.1.1. openssl 3.x has a quite breaking changed API as opposed to 1.x, mostly caused by the fact that it is a complete rewrite in C++ where older versions are plain C. ---------------------------------------------------------------------- rvk · 2023-06-11 13:39 Quote from: Thaddy on June 11, 2023, 02:45:30 pmQuote from: paweld on June 11, 2023, 01:28:14 pmfpc trunk only.  or use synapse Since when does synapse support openssl 3.x? It does not. Since trunk R260. https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/ See ssl_openssl3.pas. ---------------------------------------------------------------------- WayneSherman · 2023-06-27 16:55 Quote from: Thaddy on June 11, 2023, 02:45:30 pmAlso I use mainly trunk (always recent) and trunk also does not support openssl 3.x. It supports the long time support version of openssl 1.1.1. openssl 3.x has a quite breaking changed API as opposed to 1.x... FPC trunk has support for OpenSSL 3.0 since 2022-April: https://gitlab.com/freepascal.org/fpc/source/- /commit/59672a698267ca16ea8812f4acf932f127cc7bc0 https://gitlab.com/freepascal.org/fpc/source/- /blob/main/packages/openssl/src/openssl.pas#L111 ---------------------------------------------------------------------- abouchez · 2023-07-25 14:07 Note that mORMot 2 has OpenSSL support from 1.1 to 3.x with automatic adaptation of the API. It works with FPC 3.x compiler. See https://github.com/synopse/mORMot2/blob/master/src/lib/mormot.lib. openssl11.pas for the raw API and https://github.com/synopse/mORMot2/blob/master/src/crypt/mormot.cr ypt.openssl.pas for a set of high-level wrapper interfaces. Note that some API is broken between 1.1 and 3.x e.g. some functions did disappear, be renamed, or changed parameter size (from 32-bit to 64bit). So you need more than adding a dll name search to fully support the 3.x branch. We tested and validated our wrapper on several Linux and Windows systems, and including Mac M1. Also note that, from my experiment, OpenSSL 3.0 is way slower than OpenSSL 1.1 when setting up its internal structures and objects: for huge buffers, it is fine, but for small buffers, it has a huge overhead. It is about to be fixed in upcoming OpenSSL 3.1 IIRC. ---------------------------------------------------------------------- Fred vS · 2025-04-11 15:08 Hello. I have the same problem here on Windows 11 (on Unix OS, all is ok) with radio web streaming of mp3 and aac format. But the strange thing is that I get it only for few url. This is ok, no error: http://stream-uk1.radioparadise.com/mp3-128 But with this: https://radiorecord.hostingradio.ru/sd9096.aacp There is error while trying a http.get() or http.head(). Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Could not initialize OpenSSL library So I dont understand why for some url initialize OpenSSL is ok and for others not. I am using fpc 3.2.2 64 bit on Windows 11. ---------------------------------------------------------------------- rvk · 2025-04-11 15:10 Quote from: Fred vS on April 11, 2025, 05:08:37 pmBut the strange thing is that I get it only for few url. This is ok, no error: http://stream-uk1.radioparadise.com/mp3-128 But with this: https://radiorecord.hostingradio.ru/sd9096.aacp Notice that the first is HTTP (so without S) and the second is HTTPS. You only need openssl libs for HTTPS urls. Make sure you have the correct ones in you exe directory. ---------------------------------------------------------------------- Fred vS · 2025-04-11 15:29 Ho, you just answerd before I wanted to add a info: For http://stream-uk1.radioparadise.com/mp3-128 if you click on it here on the forum post, it will redirect to the same with a 's' ---> https://stream-uk1.radioparadise.com/mp3-128 And it works. QuoteYou only need openssl libs for HTTPS urls. Make sure you have the correct ones in you exe directory. Ha, ok, thanks. Hum, even if Windows was my first love (when it appeared long time ago), I did not follow it since XP. So the re-beginner question from where to download it? And is it possible to use the native ssl libs of Windows instead? Should I switch for something else than fpc TFPHTTPClient to have something more 'out-of-the-box'? Maybe use mORMot 2? And maybe solve also this?: https://forum.lazarus.freepascal.org/index.php/topic,70773.0.html Anyway, thanks rvk for your help and light. Fre;D ---------------------------------------------------------------------- Fred vS · 2025-04-11 15:54 Quote from: rvk on April 11, 2025, 05:10:44 pmYou only need openssl libs for HTTPS urls. Make sure you have the correct ones in you exe directory. Re-hello. I am a few lost. What is the name of those openssl libs and what version should be used for fpc 3.2.2 Windows 32 and 64 bit? ---------------------------------------------------------------------- rvk · 2025-04-11 16:28 Quote from: Fred vS on April 11, 2025, 05:29:31 pmSo the re-beginner question from where to download it? And is it possible to use the native ssl libs of Windows instead? With TFPHTTPClient you do need the openssl libs. Of you want to use the native Windows download you need to do something like URLDownloadToFile from the Windows API. I'm not sure what a current download location for the latest openssl is. In the past there was https://indy.fulgan.com/SSL/ I see they are still current but thought it wasn't the preferred download of Indy anymore. They only have 1.0.2 there but that might be sufficient for you. You can use the latest 1.0.2 version for 32 and 64 bit versions there.  If you want 1.1 and higher you'll need their GitHub but I don't know the location from memory. ---------------------------------------------------------------------- Fred vS · 2025-04-11 16:36 Quote from: rvk on April 11, 2025, 06:28:50 pmQuote from: Fred vS on April 11, 2025, 05:29:31 pmSo the re-beginner question from where to download it? And is it possible to use the native ssl libs of Windows instead? With TFPHTTPClient you do need the openssl libs. Of you want to use the native Windows download you need to do something like URLDownloadToFile from the Windows API. I'm not sure what a current download location for the latest openssl is. In the past there was https://indy.fulgan.com/SSL/ I see they are still current but thought it wasn't the preferred download of Indy anymore. They only have 1.0.2 there but that might be sufficient for you. You can use the latest 1.0.2 version for 32 and 64 bit versions there.  If you want 1.1 and higher you'll need their GitHub but I don't know the location from memory. Yep, perfect, I will try, many thanks. Have a perfect day. Fre;D ---------------------------------------------------------------------- Fred vS · 2025-04-11 16:49 Quote from: rvk on April 11, 2025, 06:28:50 pmIn the past there was https://indy.fulgan.com/SSL/ Yep, it works, just adding the dll in the root dir of the app. Many thanks!