Einzelnen Beitrag anzeigen

Benutzerbild von Zacherl
Zacherl

Registriert seit: 3. Sep 2004
4.629 Beiträge
 
Delphi 10.2 Tokyo Starter
 
#1

Indy HTTP Proxy Server + SSL = Read Timeout

  Alt 9. Sep 2011, 08:02
Hey,

ich versuche seit geraumer Zeit den Indy HTTP Proxy mit OpenSSL zum laufen zu bringen. Allerdings wirft die Indy Komponente jedes Mal, wenn ich eine Verbindung tunneln will, eine Exception mit dem Inhalt "Read Timeout".

Das komische an der Sache ist aber, wenn ich eine IdHTTP Komponente erstelle, dieser einen IdSSLIOHandlerSocketOpenSSL Handler mit selben Einstellungen zuweise und dann manuell die angeforderte SSL Seite aufrufe, dann funktioniert dies tadellos. Am Server / Certifikat / was weiß ich, kanns also nicht liegen.

Momentan habe ich folgenden Code:
Delphi-Quellcode:
procedure TForm4.IdHTTPProxyServer1HTTPBeforeCommand(
  AContext: TIdHTTPProxyServerContext);
var
  SSLClient: TIdSSLIOHandlerSocketOpenSSL;
begin
  if (TIdTCPClient(AContext.OutboundClient).Port = 443) then
  begin
    if not (AContext.OutboundClient.IOHandler is TIdSSLIOHandlerSocketOpenSSL) then
    begin
      if Assigned(AContext.OutboundClient.IOHandler) then
      begin
        AContext.OutboundClient.IOHandler.Free;
      end;
      AContext.OutboundClient.IOHandler :=
        TIdSSLIOHandlerSocketOpenSSL.Create(AContext.OutboundClient);
    end;
    SSLClient :=
      TIdSSLIOHandlerSocketOpenSSL(AContext.OutboundClient.IOHandler);
    SSLClient.SSLOptions.Method := sslvSSLv23;
    SSLClient.SSLOptions.Mode := sslmClient;
    SSLClient.SSLOptions.VerifyMode := [];
    SSLClient.PassThrough := false;
  end else if AContext.OutboundClient.IOHandler is TIdSSLIOHandlerSocketOpenSSL then
  begin
    TIdSSLIOHandlerSocketOpenSSL(AContext.OutboundClient.IOHandler).PassThrough := true;
  end;
end;
Wenn ich die Statusnachrichten vom SSL IOHandler ausgeben lasse, erkenne ich ebenfalls nichts Verdächtiges:
Code:
SSL-Status: "before/connect initialization"
SSL-Status: "before/connect initialization"
SSL-Status: "SSLv2/v3 write client hello A"
SSL-Status: "SSLv3 read server hello A"
SSL-Status: "SSLv3 read server certificate A"
SSL-Status: "SSLv3 read server key exchange A"
SSL-Status: "SSLv3 read server done A"
SSL-Status: "SSLv3 write client key exchange A"
SSL-Status: "SSLv3 write change cipher spec A"
SSL-Status: "SSLv3 write finished A"
SSL-Status: "SSLv3 flush data"
SSL-Status: "SSLv3 read finished A"
SSL-Status: "SSL negotiation finished successfully"
SSL-Status: "SSL negotiation finished successfully"
Cipher: name = DHE-RSA-AES256-SHA; description = DHE-RSA-AES256-SHA     SSLv3 Kx=DH      Au=RSA Enc=AES(256) Mac=SHA1
; bits = 256; version = TLSv1/SSLv3;
SSL-Status: "SSL negotiation finished successfully"
--> an dieser Stelle bricht die Verbindung ab
Hat jemand eine Idee, woher mein Problem kommen könnte?

Viele Grüße
Zacherl
Projekte:
- GitHub (Profil, zyantific)
- zYan Disassembler Engine ( Zydis Online, Zydis GitHub)

Geändert von Zacherl ( 9. Sep 2011 um 08:40 Uhr)
  Mit Zitat antworten Zitat