Vielleicht hilft dir diese Klasse die ich seit Jahren benutze
Delphi-Quellcode:
unit uHTTP;
interface
uses
System.Classes, IdHTTP, IdSSLOpenSSL;
type
TuHTTP=
class(TIdHTTP)
private
FIOHndl: TIdSSLIOHandlerSocketOpenSSL;
public
constructor Create;
destructor Destroy;
override;
end;
implementation
constructor TuHTTP.Create;
begin
inherited;
FIOHndl := TIdSSLIOHandlerSocketOpenSSL.Create(
nil);
Request.BasicAuthentication := True;
HandleRedirects := True;
ReadTimeout := 3000;
ConnectTimeout := 3000;
FIOHndl.ReadTimeout := 3000;
FIOHndl.ConnectTimeout := 3000;
FIOHndl.SSLOptions.SSLVersions := [sslvTLSv1_2];
IOHandler := FIOHndl;
end;
destructor TuHTTP.Destroy;
begin
FIOHndl.Free;
inherited;
end;
end.
Delphi-Quellcode:
var HTTP: TuHTTP;
HTTP := TuHTTP.Create;
try
s := HTTP.Get(
URL );
finally
HTTP.Free;
end;