[SOLVED] Synapse 40 - SSL/TLS support is not compiled! (on Linux) lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- garlar27 · 2014-07-18 20:11 I'm having problems to use THTTPSend with SSL. I followed this instructions and everything worked fine in windows (well, sort of... I added "ssl_openssl" to the uses but the project refused to compile saying "unit ssl_openssl not found" even though it was included in the package's folder, then I added that file to the lpk and rebuilt Lazarus and THEN it worked). I went to Linux and did the same with the .lpk and Lazarus. Afterward I compiled the project but I got this message error from QuoteSSL/TLS support is not compiled! I placed a breakpoint in the initialization section of ssl_openssl.pas where the plugin is configured but it looks like that this breakpoint wasn't reached. Although a blue dot appears in that line. Does anybody knows what to do solve this problem? Thanks in advance. I'm using an old Lazarus: 1.1; SVN: 40868; FPC: 2.6.2 ---------------------------------------------------------------------- BigChimp · 2014-07-19 08:48 Try indicating exactly what you did. The page you mentioned shows multiple options for SSL support... ---------------------------------------------------------------------- garlar27 · 2014-07-21 13:08 This is what I've done, and it works on windows but not in Linux: Code: [Select]uses    dateutils, strutils, dom, math, httpsend    , ssl_openssl // this include the use of the OpenSSL library.    ; function TMyClass.SendTransaction(out Response: string; const TheMsg, TheHost, ThePort: string): Boolean; var    FHTTP: THTTPSend;    AStringData: TStringStream;    SL: TStringList;    TheHostAndPort: string; begin    Result := FALSE;    Response    := '';    SL          := nil;    AStringData := nil;    if not FileExists(CertificateFile) then begin       CreateErrorFmt('Certificate File "%S" not found.', [CertificateFile]);       Exit;    end;    FHTTP  := THTTPSend.Create;    try       try          FHTTP.Protocol := '1.1';          FHTTP.Sock.SSL.CertificateFile := CertificateFile;          FHTTP.MimeType := 'text/xml';//'application/x-www-form- urlencoded';//          AStringData := TStringStream.Create(TheMsg);          FHTTP.Document.LoadFromStream(AStringData);          if IsEmpty(ThePort) then begin             TheHostAndPort := 'https://'+ TheHost;             end          else begin             TheHostAndPort := 'https://'+ TheHost +':'+ ThePort;          end;          Result := FHTTP.HTTPMethod('POST', TheHostAndPort);          SL := TStringList.Create;          SL.LoadFromStream(FHTTP.Document);          Response := SL.Text;          if not Result then begin             CreateErrorFmt('FHTTP.HTTPMethod: FHTTP.ResultCode=[%D: %S]; FHTTP.Sock.SSL.LastError=[%D: %S] (URL: %S)',                           [FHTTP.Resultcode, FHTTP.ResultString, FHTTP.Sock.SSL.LastError, FHTTP.Sock.SSL.LastErrorDesc, TheHostAndPort]                           , Response);             Exit;          end;       except          on E: Exception do begin             CreateError(GetDumpExceptionCallStack(E));          end;       end;    finally       FreeAndNil(SL);       FreeAndNil(AStringData);       FreeAndNil(FHTTP);    end; end; {<--- SendTransaction } Error message received:QuoteFHTTP.HTTPMethod: FHTTP.ResultCode=[500: ]; FHTTP.Sock.SSL.LastError=[-1: SSL/TLS support is not compiled!] (URL: https://xxx.xxx.xxx.xxx:xxxxx) I've created a symlink withthis name "libssl.so" (the library which ssl_openssl.pas is trying to use) pointing to "libssl.so.x.xx.x" and executed "ldconfig" to refresh the libraries. But the problem remains. I want to remark that this code works smoothly on windows. ---------------------------------------------------------------------- BigChimp · 2014-07-21 13:40 If you are using synapse 40 please be aware that there is a much newer version available. See http://wiki.lazarus.freepascal.org/synapse#Installation I don't know by heart whether cert files are supported by openssl with synapse; you'd have to check the documentation. ---------------------------------------------------------------------- garlar27 · 2014-07-21 14:41 Quote from: BigChimp on July 21, 2014, 03:40:52 pmIf you are using synapse 40 please be aware that there is a much newer version available. See http://wiki.lazarus.freepascal.org/synapse#Installation Well, is the last stable... May be I should try the snapshot. But first I would like to try to solve it with the stable one. Quote from: BigChimp on July 21, 2014, 03:40:52 pmI don't know by heart whether cert files are supported by openssl with synapse; you'd have to check the documentation. OpenSSL .cer files are supported by synapse. Is working on Windows, and Linux is where I got problems. ---------------------------------------------------------------------- fpcoder · 2014-07-21 15:07 Have you searched for SSL in the Synapse mailinglist? http://sourceforge.net/p/synalist/mailman/synalist-public/ ---------------------------------------------------------------------- mica · 2014-07-21 15:52 You need the devel packages (ssl-devel or whatever it is called) from your distro to compile with SSL. ---------------------------------------------------------------------- BigChimp · 2014-07-21 16:10 Quote from: garlar27 on July 21, 2014, 04:41:14 pmWell, is the last stable... May be I should try the snapshot. But first I would like to try to solve it with the stable one. Hmmm, you're right I'm sorry. I thought there was a stable release end of 2013 but I was obviously mistaken. As for the trunk version, it's mostly bug fixes & it's been rock solid for me. I understand though you want to get it working on stable and the problem quite probably is something else (e.g. the -dev packages as mentioned). ---------------------------------------------------------------------- garlar27 · 2014-07-21 20:44 Finally Installing the libssl-dev package solved the problem!!! Thank you very much!!