Why can't I get ssl to work???? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- cdbc · 2020-10-23 16:02 Hello I'm just dabbling with json, web and secure connections to learn a bit. But even a simple example ends with "Can't create ssl-context" error msg! Have a look: 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 procedure TForm1.Button3Click(Sender: TObject);var  S: string;  HTTP: TFPHttpClient;begin  HTTP:= TFPHttpClient.Create(nil);  try     HTTP.AllowRedirect:= true;    HTTP.AddHeader('User-Agent','Mozilla/5.0 (compatible; fpweb)');    S:= HTTP.Get('https://www.google.com');    Memo1.Lines.Text:= S;  finally HTTP.Free; end;  We can agree, this is not rocket-science, what gives?!? Running PcLinuxOs fully updated and the libraries are all there, should be a "Walk in the park" I'm a bit lost, please Help Regards Benny ---------------------------------------------------------------------- sstvmaster · 2020-10-23 16:44 Look at this Post: https://forum.lazarus.freepascal.org/index.php?topic=43262.0 ---------------------------------------------------------------------- cdbc · 2020-10-23 18:33 Hello I have. The example is from thaddy in that thread.... ---------------------------------------------------------------------- trev · 2020-10-23 22:14 FPC version? Operating system? ---------------------------------------------------------------------- Handoko · 2020-10-24 02:17 I modified wp's demo to make it work on my Ubuntu 19.10 Lazarus 2.0.10 by adding opensslsockets in the uses clause. It should be cross platform. As far as I know it requires at least FPC 3.2.0. Try it: ---------------------------------------------------------------------- cdbc · 2020-10-24 03:08 Hi @trev: PcLinuxOs fully updated Lazarus version 2.0.4 Fpc version 3.0.4 Regards Benny ---------------------------------------------------------------------- trev · 2020-10-24 03:34 SSL doesn't work in FPC 3.04 under Linux because it cannot find openSSL. You need FPC 3.2.0. ---------------------------------------------------------------------- cdbc · 2020-10-24 08:50 Hi @trev: Thank you. I'll get a hold of fpc 3.2.0, would that do the trick? Regards Benny ---------------------------------------------------------------------- Handoko · 2020-10-24 12:25 The SSL - Linux issue already discussed and solved. You can search the forum if you want to find the information. But no need to do it. If I remember correctly this is the summary: About a year ago, I was learning how to fetch data from http/https sites. Everything was good but after a Ubuntu update my code no longer worked. Not only me, many users have similar issue too. Because the newer versions of Linux's kernel use newer SSL library and at that time FPC still used the older one, so all Lazarus/FPC Linux users had problem with SSL connection. Many suggestions had been submitted. I tried them all but none of them worked on my tests. Until someone said the issue already fixed in FPC's trunk. So I waited and finally the Lazarus with FPC 3.2.0 released. I installed them and the SSL issue really has gone.