TFPHttpClient and openSSL woes lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Frogfather · 2018-11-25 17:17 Hi, I'm having similar problems to other folk in that requests to an http resource work fine, but those to https return the error: QuoteElnOutError Could not initialise OpenSSL library I've read all recent posts on this topic and have tried all the suggestions mentioned in them but to no effect. I've manually installed openssl.1.0.2 from source. I've also tried adding copies of the libssl and libcrypto files to the project directory. System details: -------------------------------- fpc: 3.0.4 lazarus: 1.8.2 x86_64-linux-gtk2 Fedora 29 -------------------------------- $which openssl /usr/bin/openssl $openssl version OpenSSL 1.1.1 FIPS  11 Sep 2018 One slight oddity of Fedora is that the ssl library files are in /lib64 rather than /usr/lib64. I've added this to LD_LIBRARY_PATH in my .bashrc file. The current library path is: :/lib64:/lib:/usr/lib:/usr/local/lib in /lib64 the relevant libssl files are: lrwxrwxrwx.   1 root root       16 Nov 23 20:07 libssl1.so -> libssl.so.1.0.2o -rwxr-xr-x.   1 root root   409128 Sep  3 13:40 libssl3.so lrwxrwxrwx.   1 root root       16 Aug  3 10:51 libssl.so.10 -> libssl.so.1.0.2o -rwxr-xr-x.   1 root root   474456 Aug  3 10:51 libssl.so.1.0.2o lrwxrwxrwx.   1 root root       15 Sep 17 12:03 libssl.so.1.1 -> libssl.so.1.1.1 -rwxr-xr-x.   1 root root   623016 Sep 17 12:03 libssl.so.1.1.1 similar for libcrypto: lrwxrwxrwx.   1 root root       21 Oct  8 14:08 libbd_crypto.so.2 -> libbd_crypto.so.2.0.0 -rwxr-xr-x.   1 root root    47736 Oct  8 14:08 libbd_crypto.so.2.0.0 lrwxrwxrwx.   1 root root       19 Nov 23 20:06 libcrypto1.so -> libcrypto.so.1.0.2o lrwxrwxrwx.   1 root root       19 Aug  3 10:51 libcrypto.so.10 -> libcrypto.so.1.0.2o -rwxr-xr-x.   1 root root  2692984 Aug  3 10:51 libcrypto.so.1.0.2o lrwxrwxrwx.   1 root root       18 Sep 17 12:03 libcrypto.so.1.1 -> libcrypto.so.1.1.1 -rwxr-xr-x.   1 root root  3192840 Sep 17 12:03 libcrypto.so.1.1.1 lrwxrwxrwx.   1 root root       18 Oct  9 22:04 libk5crypto.so.3 -> libk5crypto.so.3.1 -rwxr-xr-x.   1 root root   144440 Oct  9 22:04 libk5crypto.so.3.1 The code is pretty much what's in the documentation: 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 unit httpclientunit; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,  fphttpclient, openssl; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;    Memo1: TMemo;    procedure Button1Click(Sender: TObject);  private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 }   procedure TForm1.Button1Click(Sender: TObject);var S: String;var myClient: TFPHttpClient;begin  InitSSLInterface;  myClient := TFPHttpClient.Create(nil);  with myClient do  try     AllowRedirect:=true;     S:=Get('https://jsonplaceholder.typicode.com/todos/5');     Memo1.text:=S;  finally    free;  end;end; end. ---------------------------------------------------------------------- nouzi · 2018-11-25 18:32 http://forum.lazarus- ide.org/index.php/topic,40773.msg281891.html#msg281891 ---------------------------------------------------------------------- Frogfather · 2018-11-26 08:42 Hi, thanks for the reply. I did try the code mentioned in the post you referred to, but the error is thrown at the InitSSLInterface line so at this point it doesn't really make much difference what's below that line! I've tried putting copies of libssl and libcrypto in the same folder as the executable as one user suggested but same error results I'm thinking it's more a library loading than fpc issue but any suggestions that might resolve it would be welcome. ---------------------------------------------------------------------- rvk · 2018-11-26 09:07 You have a libssl.so.1.0.2o. I'm not sure Lazarus loads that one. It does try to load libssl.so.1.0.2 (without the o at the end). So you could try creating a symlink to libssl.so.1.0.2o. sudo ln -s /lib64/library.so.1.0.2o /lib64/library.so.1.0.2 sudo ln -s /lib64/libcrypto.so.1.0.2o /lib64/libcrypto.so.1.0.2 ---------------------------------------------------------------------- Frogfather · 2018-11-26 13:17 Yes that worked. Many thanks!