HTTPS SSLv3 Error Indy Delphi 7

0

I'm trying to connect via HTTPS using SSLv3 (needed to consume a specific service), but when I try to perform the post, I get the following error:

At first, I think it's a problem in configuring the components. I already did a search but I could not solve my problem. Here is the code for setting up the components and submitting:

var
   _idhttp : TIdHttp;
   _idSSL : TIdSSLIOHandlerSocket;
   _retorno : String;
begin

   _idSSL := TIdSSLIOHandlerSocket.Create(nil);
   with _idSSL do
   begin
      SSLOptions.Method := sslvSSLv3;
      SSLOptions.Mode := sslmClient;
      SSLOptions.VerifyMode := [];
      SSLOptions.VerifyDepth := 0;
   end;

   _idhttp := TIdHTTP.Create(nil);
  with _idhttp do
  begin
     IOHandler := _idSSL;
     AllowCookies := true;
     ProxyParams.BasicAuthentication := true;
     ProxyParams.ProxyPort := 0;
     request.ContentLength := -1;
     request.ContentRangeEnd := 0;
     request.ContentRangeStart := 0;
     Request.Accept := 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
     request.BasicAuthentication := false;
     request.UserAgent := 'Mozilla/3.0 (compatible; Indy Library)';
     HTTPOptions := [hoForceEncodeParams];
     HandleRedirects := true;
  end;

  retorno := _idhttp.Post(URL,xmlIn);

end;

Thank you in advance for any help. Hugs!

    
asked by anonymous 07.11.2014 / 11:53

1 answer

0

After much searching, I was able to solve my problem! First of all, I upgraded the version of Indy (Delphi 7) to the latest version.

And I also had to update and put in the application folder the SSL DLL's, which I downloaded in the following link (yes, it has captcha): link

The configuration of the components was as follows:

var
   retorno : String;//variável que recebe o retorno da requisição
   param : TStringStream;//é onde eu coloco as informações que vão ser enviadas via POST



try
  _idSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil); //SSL
  _idhttp := TIdHTTP.Create(nil);
  with _idhttp do
  begin
     IOHandler := _idSSL;
     ReadTimeout := 0;
     AllowCookies := true;
     ProxyParams.BasicAuthentication := true;
     ProxyParams.ProxyPort := 0;
     request.ContentLength := -1;
     request.ContentRangeEnd := 0;
     request.ContentRangeStart := 0;
     Request.Accept := 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
     request.ContentType := 'text/xml';
     request.CharSet := 'utf-8';
     request.UserAgent := 'Mozilla/3.0 (compatible; Indy Library)';
  end;
  param := TStringStream.Create(xmlIn.Text);//xmlIn é um objeto da classe TStringList que contém os valores a serem enviados
  retorno := _idhttp.Post(URL,param);
  result := retorno;
except
  on e: exception do
  begin
     raise Exception.Create('Erro ao enviar requisição: ' + #13 + e.Message);
     result := '';
  end;
end;

Any questions, leave a comment. I'll be happy to help.

I hope I have helped. Hugs!

    
10.11.2014 / 12:20