4

My issue is the following, I'm making RTSP requests using no authentication, basic authentication and digest authentication depending on the camera I'm trying to access. It's been working fine for a while now, but since recently when using digest authentication, I started getting the following error:

*   Trying 127.0.0.1:8554...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8554 (#0)
* Server auth using Digest with user 'ubnt'
> DESCRIBE rtsp://ubnt:[email protected]:8554/live.sdp RTSP/1.0
CSeq: 1
Accept: application/sdp

< RTSP/1.0 401 Unauthorized
< CSeq: 1
< WWW-Authenticate: Digest realm="GStreamer RTSP Server", nonce="3034e78651e4e61e"
< Server: GStreamer RTSP server
< Date: Sun, 12 Jan 2020 09:36:53 GMT
<
* Connection #0 to host 127.0.0.1 left intact
* Issue another request to this URL: 'rtsp://ubnt:[email protected]:8554/live.sdp'
* Protocol "rtsp" not supported or disabled in libcurl
* Closing connection -1

While when switching to basic auth on the exact same camera, I'm not getting any Protocol "rtsp" not supported or disabled in libcurl error, and DESCRIBE/SETUP requests are working as expected.

I thought the issue was coming from my code (I'm making curl requests from a go program, that uses libcurl bindings), but it turns out that even reverting to the first commit that uses digest authentication doesn't fix the issue.

I initially suspected a bug in newer libcurl versions, but I haven't been unable to confirm it at the moment.

Does anybody have any idea what could be the reason for my issue? Should I send an email to the libcurl mailing list about this?

Resources for more info:

Also, just to be clear, I didn't disable the rtsp protocol from libcurl, and it is enabled when running curl --version (but also, it works fine with basic auth, as stated before):

curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2
Release-Date: 2019-03-27
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS GSS-API HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets

Final additional note, I was able to reproduce this issue on Linux and MacOS, and many of the users of my project also encountered the same issue on various distributions of Linux.

8
  • can you update to curl 7.68.0 and try again? could be a bug, but hardly worth investigating on a 11 month old version Commented Jan 13, 2020 at 8:20
  • (btw my first thought was you didn't compile curl with ./configure --enable-rtsp, but since rtsp is listed under protocols, that's probably not the issue) Commented Jan 13, 2020 at 8:42
  • Hi! Thanks for your reply :) I tried with the 7.68 and the same issue happens, I also tried downgrading my version since it didn't happen about a year ago with the same code, and it didn't seem to work either but I didn't push it and try many older versions Commented Jan 13, 2020 at 15:08
  • what command are you using, exactly? for the record, i could not reproduce it with this curl command curl -v -X describe 'rtsp://ubnt:[email protected]:8554/live.sdp' using netcat server: printf 'RTSP/1.0 401 Unauthorized\r\nCSeq: 1\r\nWWW-Authenticate: Digest realm="GStreamer RTSP Server", nonce="3034e78651e4e61e"\r\nServer: GStreamer RTSP server\r\nDate: Sun, 12 Jan 2020 09:36:53 GMT\r\n\r\n' | nc -l 8554 Commented Jan 13, 2020 at 17:13
  • I'm using libcurl, not the curl CLI. Here is where the curl options are setup and the call is performed: github.com/Ullaakut/cameradar/blob/master/attack.go#L285-L287 Commented Jan 15, 2020 at 8:18

1 Answer 1

3
+100

This is most likely broken RTSP auth support in current libcurl. There's a current PR to fix this, but it has stalled ("It's more complicated than I thought").

There's a lack of people with an interest in RTSP in the curl project. We'll welcome your help to fix this.

Sign up to request clarification or add additional context in comments.

2 Comments

Aha, thanks! I'll look into this. According to the author of the PR, the protocol worked fine before the 7.66.0 version though, and I've tried downgrading to older versions than that without success. I must have made a mistake then I guess, because that would have made total sense :) I'll try downgrading again to confirm that it is because of this indeed, and if so I'd love to give a hand on fixing the issue.
I can confirm, it does work fine using older versions, including the 7.64.0! Thanks for the reply :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.