Autor Beitrag
goldensurfer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 06.09.07 08:49 
Hallo,
ich möchte einen HTTP-Zugriff ins Internet realisieren (Indy10 mit Delphi7), der über einen Proxyserver geht, welcher Authentifizierung verlangt. Folgendes Testprogramm habe ich entworfen, welches auf Buttonclick einfach den Inhalt einer geladenen Seite in einem Memo darstellen soll:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
procedure TForm1.Button1Click(Sender: TObject);
var sResult: string;
begin
  Memo1.Lines.Clear;
  idHTTP.ProxyParams.ProxyServer   := edPServer.Text;
  idHTTP.ProxyParams.ProxyPort     := StrToInt(edPPort.Text);
  idHTTP.ProxyParams.ProxyUsername := edPUser.Text;
  idHTTP.ProxyParams.ProxyPassword := edPPass.Text;
  idHTTP.Intercept := nil;
  try
    sResult := idHTTP.Get('http://www.google.de/index.html');
  except
    On E: Exception do
      begin
        Memo1.Lines.Add('Fehler:');
        Memo1.Lines.Add(E.Message);
      end;
  end;
  if (sResult <> ''then Memo1.Text := sResult;
end;


Ohne Proxy bzw. mit Proxy ohne Authentifizierung klappt das auch, nur mit der Authentifizierung läuft das Ganze in die Exception (Message="Could not load SSL library.")
Ich vermute mal, die Kommunikation zwischen Proxy und Client findet SSL-verschlüsselt statt, da ja hier Username und Passwort an den Proxyserver übergeben werden müssen.

Was ist dafür denn alles notwendig? Gibt es irgendwo vielleicht ein Beispielprogramm? In den Indy10Demos ist leider bei HTTP nur ein Server-Beispiel angegeben.

Danke,
Ralf
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 06.09.07 09:53 
Also die Fehlermeldung lässt ja darauf schließen, dass er die SSL Bibliotheken nicht finden kann.
Du kannst die DLLs auf der Seite von Indy runterladen.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 06.09.07 10:04 
Moin!

Schonmal so probiert? :nixweiss:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
var sResult: string;
begin
  Memo1.Lines.Clear;
  idHTTP.ProxyParams.ProxyServer   := edPServer.Text;
  idHTTP.ProxyParams.ProxyPort     := StrToInt(edPPort.Text);
  idHTTP.ProxyParams.ProxyUsername := edPUser.Text;
  idHTTP.ProxyParams.ProxyPassword := edPPass.Text;
  idHTTP.ProxyParams.BasicAuthentication := TRUE;
  idHTTP.Intercept := nil;
//...

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
goldensurfer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 45



BeitragVerfasst: Do 06.09.07 13:22 
BasicAuthentication auf TRUE setzen haut auch nicht hin:

ausblenden Quelltext
1:
HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied.  )					


:?