На NetHTTPClient пытаюсь назначить обработчик OnValidateServerCertificate:
type
TFrmMain = class(TForm)
...
procedure OnAuthEvent(const Sender: TObject;
AnAuthTarget: TAuthTargetType; const ARealm, AURL: string; var AUserName,
APassword: string; var AbortAuth: Boolean;
var Persistence: TAuthPersistenceType);
procedure OnValidateServerCertificate(const Sender: TObject;
const ARequest: TURLRequest; const [Ref] Certificate: TCertificate;
var Accepted: Boolean);
function TFrmMain.GetResponse2(aURL: string): TResponser;
var
Ss: TStringStream;
NetHTTPClient2:TNetHTTPClient;
Respon: IHTTPResponse;
begin
try
NetHTTPClient2:=TNetHTTPClient.Create(nil);
NetHTTPClient2.OnAuthEvent:=OnAuthEvent;
NetHTTPClient2.OnValidateServerCertificate:=OnValidateServerCertificat; // ошибка компиляции
...
with NetHTTPClient2 do
begin
Ss:=TStringStream.Create('', TEncoding.UTF8);
Respon:=Get(aURL,ss);
end;
finally
NetHTTPClient2.Free;
end;
end;
procedure TFrmMain.OnValidateServerCertificate(
const Sender: TObject; const ARequest: TURLRequest;
const [Ref] Certificate: TCertificate; var Accepted: Boolean);
begin
Accepted:=true;
end;
Получаю ошибку: Incompatible types: 'Parameter lists differ'
Как правильно сделать?