Autor Beitrag
the-kecks
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157
Erhaltene Danke: 1

Windows Vista Home Premium 64Bit
Delphi 7 Ent.
BeitragVerfasst: Mi 01.07.09 15:21 
hi,
ich hab mal wieder ein problem. ich will mich bei gamesload via SSL einloggen aber ich kriege immer den fehler "connection closed Gracefully"
code:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
[...]
    try
      HTMLCode:=IdHTTP1.Get(URL);
      Params.Add('__EVENTTARGET=loginControl%24bt_continue');
      Params.Add('__EVENTARGUMENT=');
      Params.add('__VIEWSTATE=' + readout(htmlcode, 'id="__VIEWSTATE" value=',  '" />'));
      Params.Add('loginControl%24txt_email=' + Memo2.Lines[i]); //login
      Params.Add('loginControl%24txt_pwd=' + Memo3.Lines[i]);   //pw
      Params.Add('registerControl%24txt_email=');
      Params.Add('registerControl%24txt_pwd=');
      Params.Add('registerControl%24txt_pwd2=');
      Params.Add('registerControl%24txt_fname=');
      Params.Add('registerControl%24txt_name=');
      Params.Add('registerControl%24txt_street=');
      Params.Add('registerControl%24txt_number=');
      Params.Add('registerControl%24txt_zip=');
      Params.Add('registerControl%24txt_city=');
      Params.Add('registerControl%24select_country=0');
      Params.Add('birthday_control%24txtBirthday=TT.MM.JJJJ');
      Params.Add('AgbLicence1%24chk_agb=on');
      Params.Add('__EVENTVALIDATION=' + readout(htmlcode, 'id="__EVENTVALIDATION" value=''" />'));
      IdHTTP1.Post(URL, Params);
    finally
      Params.Free;
    end;
[...]
procedure TForm1.FormCreate(Sender: TObject);
begin
  IdHTTP1.Request.UserAgent := 'Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.10) Gecko/2009042316 Firefox/3.0.10';
end;

noch ein paar einstellungen:
IdHTTP:
IOHandler = IdSSLIOHandlerSocketOpenSSL1
HandleRedicts = true
BoundPort = 0
Defaultport = 443
Port = 443
allowcookies = true

IdSSLIOHandlerSocketOpenSSL:
BoundPort = 0
Defaultport = 443
Port = 443
Method = v2
Mode Client
verify depth = 2

hoffe ihr könnt mir helfen :)

mfg


Zuletzt bearbeitet von the-kecks am Mi 01.07.09 16:14, insgesamt 2-mal bearbeitet
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10183
Erhaltene Danke: 1256

W10ent
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Mi 01.07.09 15:26 

_________________
There are 10 types of people - those who understand binary and those who don´t.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 01.07.09 15:27 
Das ist kein Fehler, sondern nur eine Ausnahme. Damit sagt dir die Indykomponente nur, dass die Verbindung einseitig geschlossen wurde, ohne dass das auch der anderen Seite vorher gesagt wurde.
the-kecks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157
Erhaltene Danke: 1

Windows Vista Home Premium 64Bit
Delphi 7 Ent.
BeitragVerfasst: Mi 01.07.09 16:13 
@narses
hab schon gesucht, hab dann die einstellungen mit port usw. übernommen aber es geht immernoch nicht

ja, dass die gegenstelle die verbindung schließt ist mir schon klar aber warum ist mir noch ein rätzel. hab ich irgendeine einstellung vergessen? und was ist mit den zertifikaten? brauch ich die als client? nein, oder?
hier nochn log:
Zitat:

idSSL: Resolving hostname god.t-online.de.
idSSL: Connecting to 80.150.6.167.
idSSL: SSL status: "before/connect initialization"
idSSL: SSL status: "before/connect initialization"
idSSL: SSL status: "SSLv2 write client hello A"
idSSL: SSL status: "SSLv2 read server hello A"
idSSL: SSL status: "SSLv2 write client master key A"
idSSL: SSL status: "SSLv2 client start encryption"
idSSL: SSL status: "SSLv2 write client finished A"
idSSL: SSL status: "SSLv2 read server verify A"
idSSL: SSL status: "SSLv2 read server finished A"
idSSL: SSL status: "SSL negotiation finished successfully"
idSSL: SSL status: "SSL negotiation finished successfully"
idSSL: Cipher: name = DES-CBC3-MD5; description = DES-CBC3-MD5 SSLv2 Kx=RSA Au=RSA Enc=3DES(168) Mac=MD5
; bits = 168; version = SSLv2;
New Cookie:
Comment:
Version:
CookieText: ASP.NET_SessionId=qdqdf345ggvms055vunhg255; path=/; domain=god.t-online.de
ServerCookie: ASP.NET_SessionId=qdqdf345ggvms055vunhg255; path=/; domain=god.t-online.de
ClientCookie: ASP.NET_SessionId=qdqdf345ggvms055vunhg255
Domain: god.t-online.de
Expires:
CookieName: ASP.NET_SessionId
Path: /
Value: qdqdf345ggvms055vunhg255
DisplayName: TIdCookieRFC2109

Redirect:
Dest: god.t-online.de/game...x?provider=gamesload
NumRedirect: 1
Handled: 1
Method: 1

idSSL: Resolving hostname god.t-online.de.
idSSL: Connecting to 80.150.6.167.
idSSL: SSL status: "before/connect initialization"
idSSL: SSL status: "before/connect initialization"
idSSL: SSL status: "SSLv2 write client hello A"
idSSL: SSL status: "SSLv2 read server hello A"
idSSL: SSL status: "SSLv2 write client master key A"
idSSL: SSL status: "SSLv2 client start encryption"
idSSL: SSL status: "SSLv2 write client finished A"
idSSL: SSL status: "SSLv2 read server verify A"
idSSL: SSL status: "SSLv2 read server finished A"
idSSL: SSL status: "SSL negotiation finished successfully"
idSSL: SSL status: "SSL negotiation finished successfully"
idSSL: Cipher: name = DES-CBC3-MD5; description = DES-CBC3-MD5 SSLv2 Kx=RSA Au=RSA Enc=3DES(168) Mac=MD5
; bits = 168; version = SSLv2;
Redirect:
Dest: god.t-online.de/game...kPaymentMethods.aspx
NumRedirect: 2
Handled: 1
Method: 1

idSSL: Resolving hostname god.t-online.de.
idSSL: Connecting to 80.150.6.167.
idSSL: SSL status: "before/connect initialization"
idSSL: SSL status: "before/connect initialization"
idSSL: SSL status: "SSLv2 write client hello A"
idSSL: SSL status: "SSLv2 read server hello A"
idSSL: SSL status: "SSLv2 write client master key A"
idSSL: SSL status: "SSLv2 client start encryption"
idSSL: SSL status: "SSLv2 write client finished A"
idSSL: SSL status: "SSLv2 read server verify A"
idSSL: SSL status: "SSLv2 read server finished A"
idSSL: SSL status: "SSL negotiation finished successfully"
idSSL: SSL status: "SSL negotiation finished successfully"
idSSL: Cipher: name = DES-CBC3-MD5; description = DES-CBC3-MD5 SSLv2 Kx=RSA Au=RSA Enc=3DES(168) Mac=MD5
; bits = 168; version = SSLv2;
Redirect:
Dest: god.t-online.de/game...emberzone/login.aspx
NumRedirect: 3
Handled: 1
Method: 1

idSSL: Resolving hostname god.t-online.de.
idSSL: Connecting to 80.150.6.167.
idSSL: SSL status: "before/connect initialization"
idSSL: SSL status: "before/connect initialization"
idSSL: SSL status: "SSLv2 write client hello A"
idSSL: SSL status: "SSLv2 read server hello A"
idSSL: SSL status: "SSLv2 write client master key A"
idSSL: SSL status: "SSLv2 client start encryption"
idSSL: SSL status: "SSLv2 write client finished A"
idSSL: SSL status: "SSLv2 read server verify A"
idSSL: SSL status: "SSLv2 read server finished A"
idSSL: SSL status: "SSL negotiation finished successfully"
idSSL: SSL status: "SSL negotiation finished successfully"
idSSL: Cipher: name = DES-CBC3-MD5; description = DES-CBC3-MD5 SSLv2 Kx=RSA Au=RSA Enc=3DES(168) Mac=MD5
; bits = 168; version = SSLv2;
idSSL: Disconnected.


mfg
the-kecks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157
Erhaltene Danke: 1

Windows Vista Home Premium 64Bit
Delphi 7 Ent.
BeitragVerfasst: Mi 01.07.09 20:48 
oder kann ich die Meldung(?) irgendwie umgehen/umschreiben, sodass der nicht direkt ganz abbricht?

mfg
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 01.07.09 20:54 
Kann es sein, dass du den Sinn von try..finally noch nicht so ganz verstanden hast? Genau das machst du doch damit. Wenn also der Fehler beim ersten Get auftritt, springt das Programm zu dem finally. Du bräuchtest also ein weiteres try..finally / try..except, das diese Meldung abfängt.
the-kecks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157
Erhaltene Danke: 1

Windows Vista Home Premium 64Bit
Delphi 7 Ent.
BeitragVerfasst: Mi 01.07.09 21:06 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
    try
      try
        HTMLCode:=IdHTTP1.Get(URL);
      except
      end;
      Params.Add('__EVENTTARGET=loginControl%24bt_continue');
      Params.Add('__EVENTARGUMENT=');
      Params.add('__VIEWSTATE=' + readout(htmlcode, 'id="__VIEWSTATE" value=',  '" />'));
      Params.Add('loginControl%24txt_email=' + Memo2.Lines[i]);
      Params.Add('loginControl%24txt_pwd=' + Memo3.Lines[i]);
      Params.Add('registerControl%24txt_email=');
      Params.Add('registerControl%24txt_pwd=');
      Params.Add('registerControl%24txt_pwd2=');
      Params.Add('registerControl%24txt_fname=');
      Params.Add('registerControl%24txt_name=');
      Params.Add('registerControl%24txt_street=');
      Params.Add('registerControl%24txt_number=');
      Params.Add('registerControl%24txt_zip=');
      Params.Add('registerControl%24txt_city=');
      Params.Add('registerControl%24select_country=0');
      Params.Add('birthday_control%24txtBirthday=TT.MM.JJJJ');
      Params.Add('AgbLicence1%24chk_agb=on');
      Params.Add('__EVENTVALIDATION=' + readout(htmlcode, 'id="__EVENTVALIDATION" value=''" />'));
      try  
        IdHTTP1.Post(URL, Params);
      except
      end;
    finally
      Params.Free;
    end;

so? habs schon so versucht das klappt auch nicht.

mfg


Zuletzt bearbeitet von the-kecks am Mi 01.07.09 21:37, insgesamt 2-mal bearbeitet
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19312
Erhaltene Danke: 1747

W11 x64 (Chrome, Edge)
Delphi 11 Pro, Oxygene, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 01.07.09 21:08 
So springt das Programm bei der Exception in Get ja ebenfalls zum finally...
Was du willst ist doch, dass dann die weiteren Befehle ausgeführt werden. Also musst du dort auch die Exception abfangen und dabei eben nicht hinter die anderen Befehle springen lassen. Also eben nur das Get in einen try-Block.
the-kecks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157
Erhaltene Danke: 1

Windows Vista Home Premium 64Bit
Delphi 7 Ent.
BeitragVerfasst: Mi 01.07.09 21:36 
sry! habs verbessert.
Jetzt macht der zwar weiter aber bei IdHTTP1.Post() kommt das auch. diese lösung mit try except hilft mir ja auch nicht weiter, ich brauch ja trotzdem den htmlcode der seite. weiß jmd vll wie ich diese meldung direkt umgehen kann? Falls das von bedeutung ist, manchmal kommt auch die exception "Error connecting with SSL".

danach kommt übrigens immer eine zugriffsverletzung wenn ich IdHTTP nochmal benutze. ich hab mal versucht die IdHTTP & die Id SSL kompo freizugeben und dann wieder zu createn aber da kommt auch ne zugriffsverletzung. habs auch mit IdHTTP1.disconnect versucht.

mfg
the-kecks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157
Erhaltene Danke: 1

Windows Vista Home Premium 64Bit
Delphi 7 Ent.
BeitragVerfasst: Do 02.07.09 12:20 
wie kann ich denn diese zugriffsverletzungen vermeiden? also die kommen immer die IdHTTP und OpenSSL. was ich aber nicht kann ist die verbindung zu trennen o. ä. weil ich die cookies, die ich beim ersten login bekommen habe noch brauche.
Genaue Exceptions:
- in OpenSSL: "Zugriffsverletzung bei Adresse 004051D0 in Modul 'Projekt1.exe'. Lesen von Adresse 00000004"
- in IdHTTP: "Zugriffsverletzung bei Adresse 0048D843 in Modul 'Projekt1.exe'. Lesen von Adresse 00000014"

mfg
the-kecks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157
Erhaltene Danke: 1

Windows Vista Home Premium 64Bit
Delphi 7 Ent.
BeitragVerfasst: So 05.07.09 20:22 
weiß niemand wie ich diese zugriffsverletzungen weg krieg?

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: Mo 06.07.09 08:44 
Compilier mal mit Mapfile (detailliert), und führ für die erhaltenen Fehlerstellen OmMAP aus. An die damit angesagten Stellen setzt Du einmal Breakpoints und schaust bitte mal in den Stack. Mit Debug-DCUs empfiehlt sich zu diesem Zweck (Achtung: Da steht dann nicht nur dein Source drin, das könnte u.U. verwirren).

_________________
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.
the-kecks Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 157
Erhaltene Danke: 1

Windows Vista Home Premium 64Bit
Delphi 7 Ent.
BeitragVerfasst: Mo 06.07.09 16:25 
also die stellen wo die fehler auftreten:
OpenSSL:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
function TIdSSLSocket.Send(const ABuf : TIdBytes): integer;
var
  err: Integer;
begin
  Result := IdSslWrite(fSSL, @ABuf[0], Length(ABuf)); //fehler
  err := GetSSLError(Result);
  if (err = OPENSSL_SSL_ERROR_WANT_READ) or (err = OPENSSL_SSL_ERROR_WANT_WRITE) then begin
    Result := IdSslWrite(fSSL, @ABuf[0], Length(ABuf));
  end;
end;

IdHTTP:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
procedure TIdCustomHTTP.ConnectToHost(ARequest: TIdHTTPRequest; AResponse: TIdHTTPResponse);
var
  LLocalHTTP: TIdHTTPProtocol;
  LS : TIdStreamVCL;
begin
  ARequest.FUseProxy := SetHostAndPort;

  if ARequest.UseProxy = ctProxy then
  begin
    ARequest.URL := FURI.URI;
  end;

[...]

  FHTTPProto.BuildAndSendRequest(URL);

  if (ARequest.Method in [hmPost, hmPut]) then //fehler
  begin
    LS := TIdStreamVCL.Create(ARequest.Source);
    try
      IOHandler.Write(LS, 0, false);
    finally
      FreeAndNil(LS);
    end;
  end;
end;

im aufruf-stack stand:
Zitat:

TIdSSLSocket.Send((71, 69, 84, 32, 47, 103, 97, 109, 101, 115, 108, 111, 97, 100, 47, 109, 101, 109, 98, 101, 114, 122, 111, 110, 101, 47, 108, 111, 103, 105, 110, 46, 97, 115, 112, 120, 32, 72, 84, 84, 80, 47, 49, 46, 49, 13, 10, 72, 111, 115, 116, 58, 32, 103, 111, 100, 46, 116, 45, 111, 110, 108, 105, 110, 101, 46, 100, 101, 58, 52, 52, 51, 13, 10, 65, 99, 99, 101, 112, 116, 58, 32, 116, 101, 120, 116, 47, 104, 116, 109, 108, 44, 32, 42, 47, 42, 13, 10, 65, 99, 99, 101, 112, 116, 45, 69, 110, 99, 111, 100, 105, 110, 103, 58, 32, 105, 100, 101, 110, 116, 105, 116, 121, 13, 10, 85, 115, 101, 114, 45, 65, 103, 101, 110, 116, 58, 32, 77, 111, 122, 105, 108, 108, 97, 47, 53, 46, 48, 32, 40, 87, 105, 110, 100, 111, 119, 115, 59, 32, 85, 59, 32, 87, 105, 110, 100, 111, 119, 115, 32, 78, 84, 32, 53, 46, 49, 59, 32, 100, 101, 59, 32, 114, 118, 58, 49, 46, 57, 46, 48, 46, 49, 48, 41, 32, 71, 101, 99, 107, 111, 47, 50, 48, 48, 57, 48, 52, 50, 51, 49, 54, 32, 70, 105, 114, 101, 102, 111, 120, 47, 51, 46, 48, 46, 49, 48, 13, 10, 67, 111, 111, 107, 105, 101, 58, 32, 65, 83, 80, 46, 78, 69, 84, 95, 83, 101, 115, 115, 105, 111, 110, 73, 100, 61, 111, 119, 106, 117, 50, 53, 113, 97, 53, 50, 118, 117, 109, 118, 113, 49, 106, 113, 106, 51, 104, 53, 53, 53, 13, 10, 13, 10))
TIdSSLIOHandlerSocketOpenSSL.SendEnc(???)
TIdSSLIOHandlerSocketOpenSSL.Send(???)
TIdSSLIOHandlerSocketOpenSSL.WriteDirect((71, 69, 84, 32, 47, 103, 97, 109, 101, 115, 108, 111, 97, 100, 47, 109, 101, 109, 98, 101, 114, 122, 111, 110, 101, 47, 108, 111, 103, 105, 110, 46, 97, 115, 112, 120, 32, 72, 84, 84, 80, 47, 49, 46, 49, 13, 10, 72, 111, 115, 116, 58, 32, 103, 111, 100, 46, 116, 45, 111, 110, 108, 105, 110, 101, 46, 100, 101, 58, 52, 52, 51, 13, 10, 65, 99, 99, 101, 112, 116, 58, 32, 116, 101, 120, 116, 47, 104, 116, 109, 108, 44, 32, 42, 47, 42, 13, 10, 65, 99, 99, 101, 112, 116, 45, 69, 110, 99, 111, 100, 105, 110, 103, 58, 32, 105, 100, 101, 110, 116, 105, 116, 121, 13, 10, 85, 115, 101, 114, 45, 65, 103, 101, 110, 116, 58, 32, 77, 111, 122, 105, 108, 108, 97, 47, 53, 46, 48, 32, 40, 87, 105, 110, 100, 111, 119, 115, 59, 32, 85, 59, 32, 87, 105, 110, 100, 111, 119, 115, 32, 78, 84, 32, 53, 46, 49, 59, 32, 100, 101, 59, 32, 114, 118, 58, 49, 46, 57, 46, 48, 46, 49, 48, 41, 32, 71, 101, 99, 107, 111, 47, 50, 48, 48, 57, 48, 52, 50, 51, 49, 54, 32, 70, 105, 114, 101, 102, 111, 120, 47, 51, 46, 48, 46, 49, 48, 13, 10, 67, 111, 111, 107, 105, 101, 58, 32, 65, 83, 80, 46, 78, 69, 84, 95, 83, 101, 115, 115, 105, 111, 110, 73, 100, 61, 111, 119, 106, 117, 50, 53, 113, 97, 53, 50, 118, 117, 109, 118, 113, 49, 106, 113, 106, 51, 104, 53, 53, 53, 13, 10, 13, 10))
TIdIOHandler.WriteBufferFlush(???)
TIdIOHandler.WriteBufferFlush
TIdIOHandler.WriteBufferClose
TIdHTTPProtocol.BuildAndSendRequest(???)
TIdCustomHTTP.ConnectToHost($278E7D4,???)
TIdCustomHTTP.DoRequest(hmPost,'https://god.t-online.de/gamesload/purchase/buy.aspx?intIdGame=31003&partner=bbyd&',$279517C,$2794650,(...))
TIdCustomHTTP.Post('https://god.t-online.de/gamesload/purchase/buy.aspx?intIdGame=31003&partner=bbyd&',???,$2794650)
TIdCustomHTTP.Post('https://god.t-online.de/gamesload/purchase/buy.aspx?intIdGame=31003&partner=bbyd&',???,$2794650)
TIdCustomHTTP.Post('https://god.t-online.de/gamesload/purchase/buy.aspx?intIdGame=31003&partner=bbyd&',$278878C)
TForm1.Button1Click(???)
Project1


hoffe ich hab das richtig verstanden

mfg