Einzelnen Beitrag anzeigen

tom77

Registriert seit: 30. Jan 2020
4 Beiträge
 
#1

IdHttp Auth Probleme 401/500 - TR-064

  Alt 30. Jan 2020, 18:58
Hallo zusammen,

ich versuche seit Stunden mich an einer fritz.box mittels idhttp und digest anzumelden(TR-064). Das Proggi läuft, sobald ich das Passwort von der fritz.box rausnehme.
Mit Passwort bekomme ich (abwechselnd) 401/500 Ausnahmen.
Laut Fiddler und Wireshark versucht idhttp es bis zu 4x sich zu authentifizieren. PHP und C# haben die Probleme nicht.

Für jede Hilfe Dankbar,

Tom

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);

var
  ss: TStringStream;
  test: UTF8String;

begin
     ss:=TStringStream.Create;
    Memo2.Lines.SaveToStream(ss);;
     IdHTTP1.ProtocolVersion:=pv1_1;
     IdHTTP1.Request.BasicAuthentication:= false;
     IdHTTP1.Request.ContentType:='text/xml; charset=utf-8';

     IdHTTP1.Request.CustomHeaders.FoldLines := false;
     IdHTTP1.Request.CustomHeaders.Values['SOAPAction']:='"urn:dslforum-org:service:X_AVM-DE_OnTel:1#GetPhonebook"';

     test:=IdHTTP1.Post('https://192.168.10.30:49000/upnp/control/x_contact',ss);
     Memo1.Lines.Add(test);
end;

Authentication: TIdAuthentication; var Handled: Boolean);
begin

  Authentication.Username:='xxx';
  Authentication.Password:='xxx';
  Handled:=true;
end;

Code:
POST /upnp/control/x_contact HTTP/1.0
Content-Type: text/xml; charset=utf-8
Content-Length: 415
SOAPAction: "urn:dslforum-org:service:X_AVM-DE_OnTel:1#GetPhonebook"
Connection: keep-alive
Host: 192.168.10.30:49000
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
User-Agent: Mozilla/3.0 (compatible; Indy Library)
Authorization: Digest username="xxx", realm="HTTPS Access", nonce="97E7957ABAFCA963", algorithm="MD5", uri="http://192.168.10.30:49000/upnp/control/x_contact", qop="auth", nc=00000001, cnonce="6919ca5976ad468de57be7ab41bedd53", response="ec38b586b80651891741d368ad4382d3"

<?xml version="1.0" encoding="utf-8"?>
   <s:Envelope
   xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
   s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <s:Body>
   <u:GetPhonebook xmlns:u="urn:dslforum-org:service:X_AVM-DE_OnTel:1">
   <NewPhonebookID xsi:type="xsd:int">0</NewPhonebookID>
   </u:GetPhonebook>
   </s:Body>
   </s:Envelope>
HTTP/1.0 401 Unauthorized
Content-Length: 170
Content-Type: text/html
Pragma: no-cache
Server: Webserver
WWW-Authenticate: Digest realm="HTTPS Access",nonce="8F17EC1501B966BD",algorithm=MD5,qop="auth"

<HTML><HEAD><TITLE>401 Unauthorized (ERR_NONE)</TITLE></HEAD><BODY><H1>401 Unauthorized</H1><BR>ERR_NONE<HR><B>Webserver</B> Thu, 30 Jan 2020 18:53:08 GMT</BODY></HTML>

Geändert von tom77 (31. Jan 2020 um 14:08 Uhr)
  Mit Zitat antworten Zitat