Skip to content

Commit

Permalink
Merge pull request #203 from Murilobeluco/master
Browse files Browse the repository at this point in the history
Adiciona suporte para certificado e chave na engine synapse
  • Loading branch information
viniciussanchez authored Apr 17, 2024
2 parents 51aa8f3 + 4fba3ec commit 95be95f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/RESTRequest4D.Request.Contract.pas
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ interface
{$ENDIF}
function Proxy(const AServer, APassword, AUsername: string; const APort: Integer): IRequest;
function DeactivateProxy: IRequest;
{$IF DEFINED(RR4D_INDY) or DEFINED(RR4D_ICS)}
{$IF DEFINED(RR4D_INDY) or DEFINED(RR4D_ICS) or DEFINED(RR4D_SYNAPSE)}
function CertFile(const APath: string): IRequest;
function KeyFile(const APath: string): IRequest;
{$ENDIF}
Expand Down
14 changes: 14 additions & 0 deletions src/RESTRequest4D.Request.Synapse.pas
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ TRequestSynapse = class(TInterfacedObject, IRequest)
function MakeURL(const AIncludeParams: Boolean = True): string;
function Proxy(const AServer, APassword, AUsername: string; const APort: Integer): IRequest;
function DeactivateProxy: IRequest;
function CertFile(const APath: string): IRequest;
function KeyFile(const APath: string): IRequest;
protected
procedure DoAfterExecute(const Sender: TObject; const AResponse: IResponse); virtual;
procedure DoBeforeExecute(const Sender: THTTPSend); virtual;
Expand Down Expand Up @@ -343,6 +345,12 @@ function TRequestSynapse.Get: IResponse;
ExecuteRequest(mrGET);
end;

function TRequestSynapse.KeyFile(const APath: string): IRequest;
begin
Result := Self;
FHTTPSend.Sock.SSL.PrivateKeyFile := APath;
end;

function TRequestSynapse.Post: IResponse;
begin
Result := FResponse;
Expand Down Expand Up @@ -372,6 +380,12 @@ function TRequestSynapse.FullRequestURL(const AIncludeParams: Boolean): string;
Result := Self.MakeURL(AIncludeParams);
end;

function TRequestSynapse.CertFile(const APath: string): IRequest;
begin
Result := Self;
FHTTPSend.Sock.SSL.CertificateFile := APath;
end;

function TRequestSynapse.ClearBody: IRequest;
begin
Result := Self;
Expand Down

0 comments on commit 95be95f

Please sign in to comment.