MJPG http stream digest authentication issue
Description
We are trying to connect to our IP camera using libvlc (Android & Desktop) to stream the MJPG stream from our AXIS camera to our Android device. We get a 401 Unauthorized even though the credentials are correct & this works perfectly in the browser.
Expected behavior
Connect with the camera and see the MJPEG stream.
Actual behavior
Connect with the camera and receiving an 401 Unauthorized in the logs.
Steps to reproduce
- Open the VLC app
- Go to More - New stream
- Add the stream to the url (LAN - http://192.168.0.160/mjpg/video.mjpg)
- Enter credentials in the dialog
- Black screen & error in logs
More information
Setting password type to:
- Encrypted & unencrypted - Stream does not work
- Encrypted only - uses digest, stream does not work
- Unencrypted only - uses basic, stream works
Logs
VLC: [91c7b970/5961] libvlc generic: creating audio output
VLC: [91dcedb0/5961] libvlc audio output: looking for audio output module matching "android_audiotrack": 4 candidates
VLC: [91dcedb0/5961] libvlc audio output: using audio output module "android_audiotrack"
VLC: [91c7b970/5961] libvlc generic: keeping audio output
VLC: [a4374030/5961] libvlc input: Creating an input for 'video.mjpg'
VLC: [a4374030/59aa] libvlc input: using timeshift granularity of 50 MiB
VLC: [a4374030/59aa] libvlc input: using default timeshift path
VLC: [a4374030/59aa] libvlc input: `http://192.168.0.160/mjpg/video.mjpg' gives access `http' demux `any' path `192.168.0.160/mjpg/video.mjpg'
VLC: [91c7b330/59aa] libvlc input source: creating demux: access='http' demux='any' location='192.168.0.160/mjpg/video.mjpg' file='(null)'
VLC: [91c7b3d0/59aa] libvlc demux: looking for access_demux module matching "http": 7 candidates
VLC: [91c7b3d0/59aa] libvlc demux: no access_demux modules matched
VLC: [91c7bb50/59aa] libvlc stream: creating access: http://192.168.0.160/mjpg/video.mjpg
VLC: [91c7bb50/59aa] libvlc stream: looking for access module matching "http": 24 candidates
VLC: [91c7bb50/59aa] http stream: resolving 192.168.0.160 ...
VLC: [91c7bb50/59aa] http stream: outgoing request:
GET /mjpg/video.mjpg HTTP/1.1
Host: 192.168.0.160
Accept: */*
Accept-Language: en_US
User-Agent: VLC/3.0.11 LibVLC/3.0.11
Range: bytes=0-
VLC/PlaylistManager: Media.Event.MetaChanged: 12
VLC/PlaylistManager: Media.Event.MetaChanged: 12
VLC: [91c7bb50/59aa] http stream: incoming response:
HTTP/1.1 401 Unauthorized
Date: Wed, 15 Jul 2020 12:09:00 GMT
Server: Apache/2.4.41 (Unix) OpenSSL/1.1.1d
WWW-Authenticate: Digest realm="AXIS_ACCC8E614E81", nonce="1Z78yXmqBQA=d04b69166848c65bb59e1c40b4db63c5a4a43341", algorithm=MD5, qop="auth"
Content-Length: 381
Content-Type: text/html; charset=iso-8859-1
VLC: [91c7bb50/59aa] libvlc stream: HTTP 401 error
VLC: [91c7bb50/59aa] libvlc stream: querying proxy for http://192.168.0.160/mjpg/video.mjpg
VLC: [91c7bb50/59aa] libvlc stream: no proxy
VLC: [91c7bb50/59aa] libvlc stream: http: server='192.168.0.160' port=80 file='/mjpg/video.mjpg'
VLC: [91c7bb50/59aa] libvlc stream: net: connecting to 192.168.0.160 port 80
VLC: [91c7bb50/59aa] libvlc stream: connection succeeded (socket = 48)
VLC: [91c7bb50/59aa] libvlc stream: sending request:
GET /mjpg/video.mjpg HTTP/1.0
Host: 192.168.0.160
User-Agent: VLC/3.0.11 LibVLC/3.0.11
Icy-MetaData: 1
VLC: [91c7bb50/59aa] libvlc stream: HTTP answer code 401
VLC: [91c7bb50/59aa] libvlc stream: Server: Apache/2.4.41 (Unix) OpenSSL/1.1.1d
VLC: [91c7bb50/59aa] libvlc stream: Authentication header: Digest realm="AXIS_ACCC8E614E81", nonce="lPb8yXmqBQA=6380045cf5833db77346e0bebc14029033214f14", algorithm=MD5, qop="auth"
VLC: [91c7bb50/59aa] libvlc stream: Using Digest Access Authentication
VLC: [91c7bb50/59aa] libvlc stream: Content-Type: text/html; charset=iso-8859-1
VLC: [91c7bb50/59aa] libvlc stream: authentication failed for realm AXIS_ACCC8E614E81
VLC: [91c75d50/59aa] libvlc keystore: looking for keystore module matching "file_crypt,none": 3 candidates
VLC: [91c75d50/59aa] libvlc keystore: using keystore module "file"
Context
App version
- Android - VLC 3.3.0 Beta 7
- MacOS - VLC 3.0.11 Vetinari
Device model
- Freescale IMX 6
- macOS Mojave 10.14.4
Camera
Tested with different Axis IP cameras:
- AXIS P1427-LE Network Camera
Linked issues
MJPG http stream with basic and digest authentification issue
Edited by Tomas Verhelst