RTSP Authentication negotiation fails

Hi, I’m trying to stream an IP Cam via RTSP.
While authenticating, the streaming plugin fails to negotiate the WWW-Authenticate header correctly.

Meetecho Janus (WebRTC Server) v1.1.4

root@cb7f2c9b3742:/ dpkg -l | grep -i curl
ii  libcurl4:amd64              7.74.0-1.3+deb11u7             amd64        easy-to-use client-side URL transfer library (OpenSSL flavour)

The mobotix cam tells the client (janus) it wants digest auth, the client ignores this, auth fails and the source is skipped:

Loading plugin 'libjanus_streaming.so'...
JANUS Streaming plugin created!
Configuration file: /usr/local/etc/janus/janus.plugin.streaming.jcfg
[janus.plugin.streaming.jcfg]
    general: {
        rtp_port_range: 10001-10070
    }
    rtsp-test: {
        type: rtsp
        id: 126
        description: RTSP Test
        audio: false
        video: true
        url: rtsp://[REDACTED]:9200/stream/profile0
        rtsp_user: test
        rtsp_pwd: test1234
        rtsp_reconnect_delay: 5
        rtsp_session_timeout: 60
        rtsp_timeout: 60
        rtsp_conn_timeout: 60
        videocodec: vp8
    }
Streaming RTP/RTCP port range: 10002 -- 10070

*   Trying [REDACTED]:9200...
* Connected to [REDACTED] ([REDACTED]) port 9200 (#0)
> DESCRIBE rtsp://[REDACTED]:9200/stream/profile0 RTSP/1.0
CSeq: 1
Accept: application/sdp

< RTSP/1.0 401 Unauthorized
< CSeq: 1
< Date: Wed, Sep 06 2023 13:01:11 GMT
< WWW-Authenticate: Digest realm="MOBOTIX Camera User", nonce="45cd93f0206dda91ef6d52140a479906"
< 
* Connection #0 to host [REDACTED] left intact
* Issue another request to this URL: 'rtsp://[REDACTED]:9200/stream/profile0'
* Found bundle for host [REDACTED]: 0x55aa11dbfea0 [serially]
* Re-using existing connection! (#0) with host [REDACTED]
* Connected to [REDACTED] ([REDACTED]) port 9200 (#0)
> DESCRIBE rtsp://[REDACTED]:9200/stream/profile0 RTSP/1.0
CSeq: 2
Accept: application/sdp

< RTSP/1.0 401 Unauthorized
< CSeq: 2
< Date: Wed, Sep 06 2023 13:01:11 GMT
* Authentication problem. Ignoring this.
< WWW-Authenticate: Digest realm="MOBOTIX Camera User", nonce="e0fdcac1308b3ad10a5171c258380614"
< 
* Connection #0 to host [REDACTED] left intact


e[31m[ERR]e[0m [plugins/janus_streaming.c:janus_streaming_rtsp_connect_to_server:7914] Couldn't get DESCRIBE code: 401
e[31m[ERR]e[0m [plugins/janus_streaming.c:janus_streaming_init:2761] Error creating 'rtsp' mountpoint 'rtsp-test'...
JANUS Streaming plugin initialized!
	Version: 10 (0.0.10)
	   [janus.plugin.streaming] JANUS Streaming plugin
	   This is a streaming plugin for Janus, allowing WebRTC peers to watch/listen to pre-recorded files or media generated by an external source.
	   Plugin API version: 102

Trying this with other clients looks like this, DESCRIBE: 401 → Digest → DESCRIBE: description

[client:rtsp] RTSP/1.0 200 OK
CSeq: 1
Date: Wed, Sep 06 2023 11:53:46 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER

[client:rtsp] DESCRIBE rtsp://[REDACTED]:9200/stream/profile0 RTSP/1.0
Accept: application/sdp
CSeq: 2
User-Agent: SFRtsp 0.3

[client:rtsp] RTSP/1.0 401 Unauthorized
CSeq: 2
Date: Wed, Sep 06 2023 11:53:46 GMT
WWW-Authenticate: Digest realm="MOBOTIX Camera User", nonce="6a6f521f76a71d35e7f6e4774c828c11"

[client:rtsp] Digest realm="MOBOTIX Camera User", nonce="6a6f521f76a71d35e7f6e4774c828c11" 

[client:rtsp] DESCRIBE rtsp://[REDACTED]:9200/stream/profile0 RTSP/1.0
Accept: application/sdp
CSeq: 3
User-Agent: SFRtsp 0.3
Authorization: Digest username="test", realm="MOBOTIX Camera User", nonce="6a6f521f76a71d35e7f6e4774c828c11", uri="rtsp://[REDACTED]:9200/stream/profile0", response="5775ac4658fccbd2164cb4bf64973953"

[client:rtsp] RTSP/1.0 200 OK
CSeq: 3
Date: Wed, Sep 06 2023 11:53:46 GMT
Content-Base: rtsp://[REDACTED]:9200/stream/profile0/
Content-Type: application/sdp
Content-Length: 458

v=0
o=- 1693991924053286 1 IN IP4 [REDACTED]
s=Mobotix IP-Camera
i=Profile profile0
t=0 0
a=tool:LIVE555 Streaming Media vmxrtp
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:Mobotix IP-Camera
a=x-qt-text-inf:Profile profile0
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:2000
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1;profile-level-id=424020;sprop-parameter-sets=Z0JAIKaAUAeZ,aM48gA==
a=control:track1
a=recvonly

Update libcurl, it was a problem there and it was solved.

1 Like

Using sucwangsr/janus-webrtc-gateway-docker:1.2.0 I only get libcurl4:amd64@7.81.0-1ubuntu1.13 as a packaged version.

Building libcurl from source (curl 8.3.0 (x86_64-pc-linux-gnu) libcurl/8.3.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) ) however, resolves the issue indeed.

Are there any recommended / up-to-date docker images which make sense to use for a production environment, or is building your own the right way?