Recent

Author Topic: Synapse https 500  (Read 141 times)

steelFrame

  • Newbie
  • Posts: 4
Synapse https 500
« on: November 29, 2019, 05:28:32 pm »
Hi. I installed synapse (as lpk), put ssleay32.dll and libeay32.dll (from here https://indy.fulgan.com/SSL/) in the project folder, and added httpsend and openssl to the uses clause, yet my simple test (from wiki) always fails with error 500 when using a https url (http works just fine).

Now, I am new to http requests, so I don't know if that is related to SSL or my request.

Code: Pascal  [Select]
  1. function DownloadHTTP(URL, TargetFile: string): Boolean;
  2. var
  3.   HTTPGetResult: Boolean;
  4.   HTTPSender: THTTPSend;
  5. begin
  6.   Result := False;
  7.   HTTPSender := THTTPSend.Create;
  8.   try
  9.     HTTPGetResult := HTTPSender.HTTPMethod('GET', URL);
  10.     showMessage(inttostr(HTTPSender.ResultCode));
  11.     if (HTTPSender.ResultCode >= 100) and (HTTPSender.ResultCode<=299) then begin
  12.       HTTPSender.Document.SaveToFile(TargetFile);
  13.       Result := True;
  14.     end;
  15.   finally
  16.     HTTPSender.Free;
  17.   end;
  18. end;
  19.  
  20. procedure TForm2.Button1Click(Sender: TObject);
  21. begin
  22.   DownloadHTTP('https://www.phoronix.com/phxcms7-css/phoronix.png','E:\phoronix.png');
  23. end;  

What am I missing? (Laz 2.0.6, fpc 3.0.4)