Autor Beitrag
k4hvd
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 22.05.07 13:58 
Hallo,
ich suche jetzt schon seit längerem nach einem beispiel für IdHTTPServer mit SSL unterstützung da ich es leider selber nicht zum laufen bringen kann. Kann mir da jemand vielleicht weiterhelfen?!
Ich benutze indy10 und indy SSL Buddy zum generieren von Zertifikaten. Bei IdTCPServer klappt alles prima aber bei httpserver nicht :(


wäre sehr dankbar für ein beispiel oder ähliches.

Gruß
Max

EDIT: habe schon eine lösung gefunden!
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Di 22.05.07 21:01 
Dann wäre es nett, wenn du diese Lösung hier auch mitteilen würdest, für die Leute, die später mal auch so ein Problem haben.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
k4hvd Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Mi 30.05.07 18:17 
Folgende zeilen müssen vorhanden sein damit IdHTTP mit SSL funktioniert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
procedure TForm1.IdHTTPServer1Connect(AContext: TIdContext);
begin
  if (AContext.Connection.IOHandler is TIdSSLIOHandlerSocketBase) then
    TIdSSLIOHandlerSocketBase(AContext.Connection.IOHandler).PassThrough:= false;
end;

procedure TForm1.IdServerIOHandlerSSLOpenSSL1GetPassword(var Password: string);
begin
  password:= 'aaaa'// Das kennwort mit dem der Zertifikatschlussel erstellt worden ist.
end;


Zudem natürlich ein Zertifikat die man zum Beispiel mit SSLBuddy (von Indy) erstellen kann und die OpenSSL libs: libeay32.dll, ssleay32.dll.

Max.