Authentication problem with RTSP

620 views
Skip to first unread message

ThaiDai

unread,
Sep 6, 2022, 2:45:30 AM9/6/22
to meetecho-janus
I'm getting 401-Errors in Janus when connecting to a RTSP-Stream from a HikVision NVR (authentication for RTSP set to "digest/basic").

When I replace CURLAUTH_ANY with CURLAUTH_BASIC in janus_streaming.c 
in curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY)
the authentication succeeds and I will see a (sub)-stream in the streaming demo.

So "_ANY" isn't working ("This is a convenience macro that sets all bits and thus makes libcurl pick any it finds suitable. libcurl will automatically select the one it finds most secure") as expected. 

I even tried _DIGEST, _DIGEST_IE, _NEGOTIATE but with no luck (but will try again with more coffee and _ANYSAFE).


Lorenzo Miniero

unread,
Sep 6, 2022, 4:19:15 AM9/6/22
to meetecho-janus
Depending on the version you use, RTSP auth in curl is currently broken. In my case, it works if I use 7.78.0 but doesn't starting from 7.79.0. As such, you may want to try a different curl version in case you're affected because of that. You can find more info here: https://github.com/curl/curl/pull/4750

L.

ThaiDai

unread,
Sep 7, 2022, 3:54:37 AM9/7/22
to meetecho-janus
Thanks!
Switched to the old version and using CURLAUTH_ANY works now.

Now I can connect to 9 Cameras (4 HikVision Cams, 2 Dome Cams (Hik compatible, Watashi) and 3 Raspi-Cams) in Thailand and stream using Janus/ZoneMinder on a netcup server in Germany.

Raspis and the Watashi work with resolutions up to Full-HD!

Sadly the HikVision Cams only work with the second stream (640x360). Switching to main stream shows nothing (but Janus is sending data but "Can't retransmit packet ..., we don't have it").
Seems to be a problem with the HikVision NVR and using Wireguard Tunnels and/or the "distance" TH/DE.

So I will install Janus in Thailand on a raspi for testing this in a local environment.

But again: thanks for your immediate reply and help.
Reply all
Reply to author
Forward
0 new messages