Skip to content

Commit

Permalink
EETHttpClient ValidateCertificateEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
mirus77 committed Dec 20, 2019
1 parent 0d240c6 commit 2bb54f2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion source/httpclient/u_EETHttpClient_Net.pas
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,16 @@ procedure TEETHttpClientNet.SendRequest(aUrl : String; aRequestStream: TStream;
procedure TEETHttpClientNet.ValidateCertificateEvent(const Sender: TObject;
const ARequest: TURLRequest; const Certificate: TCertificate;
var Accepted: Boolean);
var
bRes : boolean;
begin
{* Trigger only if server certificate is not valid for HttpClient !!! *}
Accepted := False;
bRes := False;
if (Certificate.Start < now) and (now < Certificate.Expiry) then
bRes := True;
if bRes and (HttpsTrustName <> '') then
bRes := Certificate.ProtocolName = HttpsTrustName; // www.eet.cz
Accepted := bRes;
end;

end.

0 comments on commit 2bb54f2

Please sign in to comment.