1
votes

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

1
Declare USE_INDY and rebuild the project to use Indy for THTTPRio (see stackoverflow.com/q/26911550/80901) - mjn
Am I missing something or does Soap.SOAPHTTPTrans.pas for Delphi 10.3.2 not have that compiler directive? - Marty Loftus
Are you using THTTPRio on older (WinXP) platforms, which do not support this? Because THTTPRio is based on Wininet which automatically supports tls 1.2 when using Win7 or up. - R. Hoek

1 Answers

1
votes

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');