Autor Beitrag
jackie05
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Di 02.11.10 05:07 
Hallo,
ich versuche mit IdHTTP eine gesicherte Seite (https) auszulesen, leider bekomme ich folgende fehlermeldung:
user defined image

Hier mal mein Code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
var
  Quelltext: string;
begin
  LoadOpenSSLLibrary;

  IdHttpLoader.IOHandler := IdSSLIOHandlerSocketOpenSSL1;
  IdHttpLoader.Request.UserAgent := 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10';
  IdHttpLoader.HandleRedirects := true;
  try
    Quelltext := IdHttpLoader.Get('https://www.testseite.com/');

    WB_LoadHTML(WebBrowser1,Quelltext);
  finally

  end;


IdSSLIOHandlerSocketOpenSSL1:
SSL Options:
Method: sslvSSLv2
Mode: sslmClient

Kann mir Vielleicht jemand helfen woran der fehler liegen könnte?

Ich bedanke mich schonmal im Voraus.

MfG
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 02.11.10 05:13 
Ist die OpenSSL-Lib/DLL von deiner App aus aufrufbar? Z.B. gleiches Verzeichnis?

Was sagen reguläre HTTPS-Clients dazu? Also OpenSSL und z.B. Firefox?

Ach ja: Eine Bitte aus Webmaster-Sicht: Bitte impersonate mit deinem User-Agent keine regulären Browser oder andere Programme. Steh zu deinem Programm und announce das bitte auch.

Edit: Ach ja: Siehe Stack Overflow

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
jackie05 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Di 02.11.10 05:17 
Danke Dir.

Ich hab das erstmal zum Test benutzt.
Die beide DLL Dateien (libeay32.dll und ssleay32.dll) sind im gleichen Verzeichnis.

Woran könnte das denn liegen?
Muss ich Vielleicht ein Zertifikat erstellen um die Verbindung aufzubauen?

MfG
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 02.11.10 05:19 
Siehe mein Edit im vorigen Post, hab noch was ergänzt.

Und ja: Du solltest gültige Zertifikate verwenden. Siehe z.B. CAcert, falls Du welche brauchst.

Darf man die reguläre URL mal erfahren für die SSL-Seite, oder ist das ne interne Seite? Also für nen externen Test der SSL-Verbindung?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
jackie05 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Di 02.11.10 05:28 
Naja, wollte ein Download Manager schreiben für verschiedene Hoster wie z.B. www.uploaded.to etc.

Ich habe dein Edit gesehn und auf dieser Seite war ich ja schon bereits und trotzdem funktioniert es nicht, jetzt erhalte ich folgende fehlermeldung:
Socket Error # 0

da ich die Methode von SSL Options auf sslvSSLv23 geändert habe.

Was könnte ich noch tun damit es mal funktioniert?

MfG
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 02.11.10 05:38 
Welche Delphi-Version? Welche Indy-Version? Welche OpenSSL-Version?

Updates von Indy und OpenSSL schon probiert?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
jackie05 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Di 02.11.10 05:49 
Delphi 2010 Testversion
Indy Version 10.5.5

Welche OpenSSL Version ich habe, weiss ich jetzt nicht.
Ich denke mal das diese bei Delphi 2010 aktuell sind oder irre ich mich?

Edit: Ich habe jetzt folgendes bei IdHTTP geändert:
HTTP Options:
ausblenden Delphi-Quelltext
1:
2:
hoInProcessAuth := true;
hoKeepOrigProtocol := true;


jetzt funktioniert das ganze.

Danke trotzdem für die Hilfe.

MfG