Open mCr86 opened 4 years ago
I think that this info could be usefull: Is a part of the response of a succefully connection using openRSTP:
Sending request: DESCRIBE rtsp://888888:888888@192.168.1.82:554/stream2 RTSP/1.0
CSeq: 3
User-Agent: ./openRTSP (LIVE555 Streaming Media v2020.06.23)
Accept: application/sdp
Received 175 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 401 Unauthorized
CSeq: 3
Date: Thu, Jun 25 2020 10:17:47 GMT
WWW-Authenticate: Digest realm="TP-LINK Streaming Media", nonce="de0cc178e4e28dbd8774b364bafa17b4"
Resending...
Sending request: DESCRIBE rtsp://888888:888888@192.168.1.82:554/stream2 RTSP/1.0
CSeq: 4
Authorization: Digest username="888888", realm="TP-LINK Streaming Media", nonce="de0cc178e4e28dbd8774b364bafa17b4", uri="rtsp://888888:888888@192.168.1.82:554/stream2", response="b64b796d8cddd99c9d632c0ee38078f9"
User-Agent: ./openRTSP (LIVE555 Streaming Media v2020.06.23)
Accept: application/sdp
Received 725 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 4
Date: Thu, Jun 25 2020 10:17:48 GMT
Content-Base: rtsp://192.168.1.82/stream2/
Content-Type: application/sdp
Content-Length: 564
more info:
// Note: If a HTTP "GET" command (for RTSP-over-HTTP tunneling) returns "401 Unauthorized", then we resend it
// (with an "Authorization:" header), just as we would for a RTSP command. However, we do so using a new TCP connection,
// because some servers close the original connection after returning the "401 Unauthorized".
resetTCPSockets(); // forces the opening of a new connection for the resent command
line 1900 RTSPClient.cpp of OpenRTSP.
more info:
After the first DESCRIBE, code go to checkAuth(), but do not enter in if(Regex.Regex(RtspResponse.c_str(), PatternDigest.c_str(), &Group)) {
Then, do not create the digest authetification response.
But I do not know why. I do not understand Regex object.
The parameters of this if() are:
RtspResponse.c_str() =
RTSP/1.0 401 Unauthorized
CSeq: 2
Date: Thu, Jun 25 2020 15:12:29 GMT
WWW-Authenticate: Digest realm="TP-LINK Streaming Media", nonce="61b9e59fd8cd891f95b1c0170ab3aa00"
PatternDigest.c_str() = *Digest +realm="([a-zA-Z_0-9 ]+)", *nonce="([a-zA-Z0-9]+)"
&Group = 0x7ffdd12733a0
I found the error:
In this pattern: PatternDigest("WWW-Authenticate: *Digest +realm=\"([a-zA-Z_0-9 ]+)\", *nonce=\"([a-zA-Z0-9]+)\"");
You don't contemplate hyphen caracter of "TP-LINK".
Solution:
string PatternDigest("WWW-Authenticate: *Digest +realm=\"([-a-zA-Z_0-9 ]+)\", *nonce=\"([a-zA-Z0-9]+)\"");
Hi there,
I am triying to connect a TP-Link C200 Camera. Using OpenRTSP I can connect perfectly using
./openRTSP -t -4 -P 10 rtsp://888888:888888@192.168.1.82:554/stream2
With myRtspClient I use./complete_example rtsp://192.168.1.82:554/stream2
, previously I am set username and password in complete_example.cpp. the response is:The error is in line 2000 of rtspClient.cpp:
If I change
return CHECK_ERROR
forreturn CHECK_OK
The new response is:My RTSP knowledge is null. Could you help me?
Thanks!