Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adiciona suporte para certificado e chave na engine synapse #203

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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