Marty Loftus
Marty Loftus

Reputation: 51

THTTPRio TLS 1.2

I am trying to support TLS 1.2 using the THTTPRio component.

I have supported TLS 1.2 before in other projects using TIdSSLIOHandlerSocketOpenSSL with the TIdHTTP's IOHandler. This one is SOAP so I am trying to stick with the HTTPRio Component.

It doesn't seem to have access to the IOHandler unless I can enable the INDY_CUSTOM_IOHANDLER Directive and then access it via THttpRio.HTTPWebNode.

I guess my options are:

  1. Force THTTPRio to use INDY, but I'm not sure how and what affects that will have.
  2. Manually create and parse the soap packets and use TIdHTTP.

Is there a better way than either of those options?

Delphi 10.2 Version 25.0.29899.2631 Indy version: 10.6.2.5366

Upvotes: 1

Views: 2653

Answers (1)

R. Hoek
R. Hoek

Reputation: 1106

I don't know where to start using Delphi 10.2, but with Delphi 10.3 the internal HTTP client has been replaced with a new (cross-platform) THttpClient (unit System.Net.HttpClient) which on Windows uses a TWinHTTPClient (base on Winapi.WinHTTP) instance to do the actual work.

To use Indy you need to implement your own custom THTTPClient based on Indy and Unregister the current http/https handlers using:

TURLSchemes.UnRegisterURLClientScheme('HTTP');
TURLSchemes.UnRegisterURLClientScheme('HTTPS');

And then register you custom Indy implementation using:

TIndyHTTPClient = class(THTTPClient)
  // Your implementation
end;

TURLSchemes.RegisterURLClientScheme(TIndyHTTPClient, 'HTTP');
TURLSchemes.RegisterURLClientScheme(TIndyHTTPClient, 'HTTPS');

Upvotes: 1

Related Questions