Skip to content

Commit

Permalink
enhanced TLS support in TRestHttpClientSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Bouchez committed Jun 18, 2022
1 parent 4f9f551 commit 893a006
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mormot.commit.inc
@@ -1 +1 @@
'2.0.3474'
'2.0.3475'
9 changes: 8 additions & 1 deletion src/rest/mormot.rest.http.client.pas
Expand Up @@ -170,6 +170,8 @@ TRestHttpClientGeneric = class(TRestClientUri)

/// returns 'Server:Port' current value
function HostName: RawUtf8;
/// low-level access to the HTTP request TLS options
function TLS: PNetTlsContext;
/// optional custom HTTP "User Agent:" header value
property UserAgent: RawUtf8
read fExtendedOptions.UserAgent write fExtendedOptions.UserAgent;
Expand Down Expand Up @@ -715,6 +717,11 @@ function TRestHttpClientGeneric.HostName: RawUtf8;
result := '';
end;

function TRestHttpClientGeneric.TLS: PNetTlsContext;
begin
result := @fExtendedOptions.TLS;
end;


{ ************ TRestHttpClientSocket REST Client Class over Sockets }

Expand All @@ -730,7 +737,7 @@ procedure TRestHttpClientSocket.InternalOpen;
if fSocketClass = nil then
fSocketClass := THttpClientSocket;
fSocket := fSocketClass.Open(
fServer, fPort, nlTcp, fConnectTimeout, fHttps);
fServer, fPort, nlTcp, fConnectTimeout, fHttps, @fExtendedOptions.TLS);
{$ifdef VERBOSECLIENTLOG}
if LogClass <> nil then
fSocket.OnLog := LogClass.DoLog; // verbose log
Expand Down

0 comments on commit 893a006

Please sign in to comment.