[SOLVED]Synapse, Ubuntu 19.04 and https lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- bonmario · 2019-04-26 16:25 Hi, sorry for my bad english ... I have more program, developed with Lazarus and Synapse, that download some files or read headers from links "https". These programs worked fine with Ubuntu 18.10. Some days ago, i have updated my Ubuntu from 18.10 to 19.04. From that moment, all my programs have this problem: 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 **************************************fHttp.Resultcode:             "500"fHttp.Resultstring:           ""fHTTP.Protocol:               "1.0"fHttp.Sock.SSL.LibName:       "ssl_openssl"fHttp.Sock.SSL.LibVersion:    ""fHttp.Sock.SSL.LastError:     "336236740"fHttp.Sock.SSL.LastErrorDesc: "error:140A90C4:SSL routines:func(169):reason(196)" ************************************** fHTTP is declared "fHTTP:THTTPSend;" - i have reinstalled openssl but i have the same problem - i have compiled openssl from sources but i have the same problem - i have created a virtual machine with Ubuntu 18.10 and all my programs works fine - i have created a virtual machine with Ubuntu 19.04 and all my programs have the same problem. Someone can help me? Thanks in advance, Mario ---------------------------------------------------------------------- Leledumbo · 2019-04-27 13:39 You're not alone, if you search the web, you'll find a lot of similar problem. The root cause is that your program is compiled for a version of OpenSSL that Ubuntu 19.04 supersedes with newer one. To be precise, 1.0.X vs 1.1.X. The library is intentionally not made backward compatible due to security concerns of 1.0.X design flaw. The proper solution is to update the OpenSSL unit (and all other units depending on it) to use version 1.1.X definitions. A workaround is to install 1.0.X version then force your program to run against it, in which there are multiple solutions to do so. ---------------------------------------------------------------------- bonmario · 2019-04-27 14:36 Quote from: Leledumbo on April 27, 2019, 03:39:58 pmYou're not alone, if you search the web, you'll find a lot of similar problem. The root cause is that your program is compiled for a version of OpenSSL that Ubuntu 19.04 supersedes with newer one. Sorry, but I'm not understanding. I compile my program with Lazarus, and I don't remember having set up anywhere for which version of OpenSSL it has to compile. Moreover, even if I recompile the source, the problem remains. P.S. I have a similar problem with fcl-web. Thanks again, Mario ---------------------------------------------------------------------- lucamar · 2019-04-27 17:40 Quote from: bonmario on April 27, 2019, 04:36:56 pmSorry, but I'm not understanding. I compile my program with Lazarus, and I don't remember having set up anywhere for which version of OpenSSL it has to compile. Most networking code (Synapse, fpweb, etc.) expects OpenSSL version 1.0 by design (without you having to do anything) but Ubuntu 19 installs a much more recent version. As explained by Leledumbo, those newer versions are deliberately incompatible because security concerns, so when your program tries to load the OpenSSL lib it finds something totally different to what it's looking for. ---------------------------------------------------------------------- bylaardt · 2019-04-27 22:30 libssl-dev install the links needed to compatibilize with older versions: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ sudo apt- get install libssl-dev ---------------------------------------------------------------------- bonmario · 2019-04-28 06:24 Quote from: lucamar on April 27, 2019, 07:40:39 pmMost networking code (Synapse, fpweb, etc.) expects OpenSSL version 1.0 by design (without you having to do anything) but Ubuntu 19 installs a much more recent version. As explained by Leledumbo, those newer versions are deliberately incompatible because security concerns, so when your program tries to load the OpenSSL lib it finds something totally different to what it's looking for. Ok, but also in Ubuntu 18.10 OpenSSL is at 1.1: Quotebonmario@bonmario-VirtualBox:~$ dpkg -l '*ssl*' Voluto=U (non noto)/I (installato)/R (rimosso)/P (rimosso totale)/H (in attesa) | Stato=Non/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig- aWait/Trig-pend |/ Err?=(nessuno)/R (reinstallazione richiesta) (Stato,Err: maiuscolo=grave) ||/ Nome                        Versione           Architettura       Descrizione +++-===========================-==================-==================- =========================================================== un  docbook-dsssl                                   (nessuna descrizione disponibile) un  libcrypt-openssl-bignum-per                     (nessuna descrizione disponibile) un  libcrypt-openssl-dsa-perl                       (nessuna descrizione disponibile) un  libcrypt-openssl-pkcs10-per                     (nessuna descrizione disponibile) un  libcrypt-openssl-pkcs12-per                     (nessuna descrizione disponibile) un  libcrypt-openssl-rsa-perl                       (nessuna descrizione disponibile) un  libcrypt-openssl-x509-perl                      (nessuna descrizione disponibile) un  libcrypt-ssleay-perl                            (nessuna descrizione disponibile) un  libengine-pkcs11-openssl                        (nessuna descrizione disponibile) un  libhttp-daemon-ssl-perl                         (nessuna descrizione disponibile) ii  libio-socket-ssl-perl       2.060-3            all                Perl module implementing object oriented interface to SSL s ii  libnet-smtp-ssl-perl        1.04-1             all                Perl module providing SSL support to Net::SMTP ii  libnet-ssleay-perl          1.85-2ubuntu2      amd64              Perl module for Secure Sockets Layer (SSL) ii  libssl1.0.0:amd64           1.0.2n-1ubuntu6    amd64              Secure Sockets Layer toolkit - shared libraries ii  libssl1.1:amd64             1.1.1-1ubuntu2     amd64              Secure Sockets Layer toolkit - shared libraries ii  openssl                     1.1.1-1ubuntu2     amd64              Secure Sockets Layer toolkit - cryptographic utility un  openssl-blacklist                               (nessuna descrizione disponibile) un  perl-openssl-abi-1.1                            (nessuna descrizione disponibile) ii  perl-openssl-defaults:amd64 3build1            amd64              version compatibility baseline for Perl OpenSSL packages un  python3-openssl                                 (nessuna descrizione disponibile) ii  ssl-cert                    1.0.39             all                simple debconf wrapper for OpenSSL un  wget-ssl                                        (nessuna descrizione disponibile) bonmario@bonmario-VirtualBox:~$ Quote from: bylaardt on April 28, 2019, 12:30:49 amlibssl-dev install the links needed to compatibilize with older versions: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ sudo apt- get install libssl-dev It's already installed ... Thanks, Mario ---------------------------------------------------------------------- bylaardt · 2019-04-28 13:08 i don't think so! i only see libssl, not libssl-dev! my results on dpkg: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ dpkg -l '*ssl*' | grep libssl-devii  libssl-dev:amd64             1.1.1b-1ubuntu2 amd64        Secure Sockets Layer toolkit - development files ---------------------------------------------------------------------- bonmario · 2019-04-28 15:14 This is the output: 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 bonmario@bonmario-desktop:~$ dpkg -l '*ssl*' | grep libssl-devii  libssl-dev:amd64                1.1.1b-1ubuntu2 amd64        Secure Sockets Layer toolkit - development filesbonmario@bonmario-desktop:~$ but the problem is not solved. Thanks, Mario ---------------------------------------------------------------------- bylaardt · 2019-04-28 15:48 I'm usin sftp and https downloads and works fine. maybe another dependencies? like libcurl? Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $ dpkg -l '*-dev' | grep sslun  libcurl-ssl-dev                                                (nenhuma descrição disponível)un  libcurl3-openssl-dev                                          (nenhuma descrição disponível)ii  libcurl4-openssl- dev:amd64                   7.64.0-2ubuntu1        amd64        development files and documentation for libcurl (OpenSSL flavour)ii  libssl-dev:amd64                             1.1.1b-1ubuntu2        amd64        Secure Sockets Layer toolkit - development filesun  libssl1.0-dev ---------------------------------------------------------------------- bonmario · 2019-04-28 17:33 Quote from: bylaardt on April 28, 2019, 05:48:09 pmI'm usin sftp and https downloads and works fine. Also you with Ubuntu 19.04? Quote from: bylaardt on April 28, 2019, 05:48:09 pmmaybe another dependencies? like libcurl? Installed now, but problem is not solved. Thanks, Mario ---------------------------------------------------------------------- john horst · 2019-04-28 18:13 You have two options, like was said above. You have more to do than just install libssl-dev. Installing two ssl libs is the wrong way to go about it. Your system is not going to pick and choose which version your program needs, your program did this in the ssl unit. Your program is trying to use 1.1.1 because that is what it will find by default. You would need to change symlinks etc for it to point at the 1.0 lib. You could write a wrapper and point it at the 1.0 lib if you choose. The correct way, like Leledumbo said, is change the 1.0 in the pascal source units to 1.1. ---------------------------------------------------------------------- bylaardt · 2019-04-28 18:33 Quote from: bonmario on April 28, 2019, 07:33:08 pmAlso you with Ubuntu 19.04? Kubuntu minimal 19.04 ---------------------------------------------------------------------- bylaardt · 2019-04-28 18:43 Quote from: john horst on April 28, 2019, 08:13:03 pmInstalling two ssl libs is the wrong way to go about it. Your system is not going to pick and choose which version your program needs, your program did this in the ssl unit. Your program is trying to use 1.1.1 because that is what it will find by default. You would need to change symlinks etc for it to point at the 1.0 lib. You could write a wrapper and point it at the 1.0 lib if you choose. I have just install 1.1 (default) and the -dev packages.  then symbolic links  needed comes from -dev package and keeps it updated whatever new version comes true. ---------------------------------------------------------------------- rvk · 2019-04-28 18:44 Quote from: Leledumbo on April 27, 2019, 03:39:58 pmThe proper solution is to update the OpenSSL unit (and all other units depending on it) to use version 1.1.X definitions. Doesn't the latest version of Synapse (ssl_openssl.pas) already work with 1.1.0? So why shouldn't it also work with 1.1.1 (these should be compatible). Just make sure you're using the r206+/trunk version of Synapse. ---------------------------------------------------------------------- bonmario · 2019-04-28 19:19 Quote from: rvk on April 28, 2019, 08:44:17 pmJust make sure you're using the r206+/trunk version of Synapse. The problem was that: i was using last stable release, 2012-04-23 - release no. 40. I've downloaded the r209/trunk version and now all works fine. Thanks, Mario