Hi all,
Following on from my post
here, I've worked out that it is just HTTPS URLs that fail. However,
https://google.com works (as does google.co.uk). I get, for Bing for example, is
Connect to www.bing.com:443 failed.I have absolutely no idea how to find out what version of FPHTTPClient, or OpenSSL, I am using or even where to find a newer version or even how to install it.
I'm using Lazarus 3.0 on macOS 15.
The code is currently:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs,ExtCtrls,StdCtrls,
fphttpclient, openssl, opensslsockets;
type
{ TForm1 }
TForm1 = class(TForm)
Button1:TButton;
Memo1:TMemo;
Panel1:TPanel;
procedure Button1Click(Sender:TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender:TObject);
begin
InitSSLInterface;
With TFPHTTPClient.Create(Nil) do
begin
AllowRedirect:=True;
AddHeader('User-Agent', 'Mozilla/5.0 (compatible; fpweb)');
try
try
Memo1.Lines.Add(Get('https://www.bing.com'));
except on E: Exception do
Memo1.Lines.Add(E.Message);
end;
finally
Free;
end;
end;
end;
end.
I have seen some code using "ValidateSSLCertificate" with TFPHTTPClient, but Lazarus reports this as unknown.