Search code examples
curllibcurlrtsp

libcurl unsupported protocol only when using digest authentication


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.


Solution

  • 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.