2

I want to get data from the site https://exergy.skmenergy.com. I use TIdHttp. My settings

  FHttp := TIdHTTP.Create(nil);
  FSSLIOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
  FSSLIOHandler.MaxLineAction := maException;
  FSSLIOHandler.SSLOptions.Method := sslvSSLv23;
  FSSLIOHandler.SSLOptions.Mode := sslmUnassigned;
  FSSLIOHandler.SSLOptions.SSLVersions := [sslvSSLv2, sslvSSLv3, sslvTLSv1, sslvTLSv1_1, sslvTLSv1_2];

  FCookie := TIdCookieManager.Create(nil);

  with FHttp do
  begin
    IOHandler := FSSLIOHandler;
    CookieManager := FCookie;
    AllowCookies := True;
    HandleRedirects := True;
    Request.BasicAuthentication := True;
    if StrToBoolDef(FParam.Items['ProxyUse'], True) = True then
    begin
      ProxyParams.ProxyPort := StrToInt(FParam.Items['Port']);
      ProxyParams.ProxyServer := FParam.Items['Server'];
      ProxyParams.ProxyUsername := FParam.Items['Login'];
      ProxyParams.ProxyPassword := FParam.Items['ProxyPassword'];
    end;
    ReadTimeout := 100000000;
  end;

But in code i call from thread

FHTTP.Get('https://exergy.skmenergy.com);

I get an error Error connecting with ssl. eof was observed that violates the protocol delphi. UPD

enter image description here

Files libeay32.dll and ssleay32.dll include in project. Version 1.1.0.1 I use Embarcadero® RAD Studio 10.2 Version 25.0.29039.2004

gregor
  • 271
  • 4
  • 10
  • Is this the exact error message? Almost everything in lowercase? Your call misses an apostroph to end the literal. – AmigoJack Jan 19 '21 at 10:22
  • @AmigoJack update question – gregor Jan 19 '21 at 10:29
  • https://stackoverflow.com/questions/35987485/ quotes the message correctly (not including "delphi"). Answers there suggest using one version per attempt, instead of enabling everything right away. https://stackoverflow.com/a/55906141/4299358 indicates the certificate to be a problem. – AmigoJack Jan 19 '21 at 12:13
  • 1
    @gregor, I had similar problems in one of my projects. Solved it by using different versions of the libeay32.dll and ssleay32.dll – Mark Jan 25 '21 at 11:18

1 Answers1

0

Indy does not support OpenSSL 1.1.xx.

Need to use OpenSSL version 1.0.2 https://github.com/IndySockets/OpenSSL-Binaries

gregor
  • 271
  • 4
  • 10