EIdOSSLUnderlyingCryptoError Exception

后端 未结 3 1160
小蘑菇
小蘑菇 2021-01-03 10:37

I am using Indy (IdHTTP, OpenSSL). I use this simple code to download a page

var
  IdHTTP: TIdHTTP;
begin
  IdHTTP:=TIdHTTP.Create;
  try
    IdHTTP.Get(\'ht         


        
3条回答
  •  一个人的身影
    2021-01-03 11:06

    This code works with the 5273 revision and OpenSSL 1.0.2 / 1.0.2a:

    program HttpsGetExample;
    
    {$APPTYPE CONSOLE}
    
    uses
      IdHTTP, IdGlobal, SysUtils, Classes;
    
    var
      HTTP: TIdHTTP;
      ResponseBody: string;
    begin
      HTTP := TIdHTTP.Create;
      try
        try
          ResponseBody := HTTP.Get('https://ezfile.ch');
          WriteLn(ResponseBody);
          WriteLn(HTTP.ResponseText);
        except
          on E: EIdHTTPProtocolException do
          begin
            WriteLn(E.Message);
            WriteLn(E.ErrorMessage);
          end;
          on E: Exception do
          begin
            WriteLn(E.Message);
          end;
        end;
      finally
        HTTP.Free;
      end;
      ReadLn;
      ReportMemoryLeaksOnShutdown := True;
    end.
    

提交回复
热议问题