Skip to content

Conversation

ljhljh127
Copy link

  • Change algorithm selection to prefer MD5 digest over SHA256
  • Improves compatibility with cameras that don't support QOP
  • Aligns with FFmpeg behavior and VDK library approach
  • Fixes 401 authentication errors with multi-algorithm cameras

- Change algorithm selection to prefer MD5 digest over SHA256
- Improves compatibility with cameras that don't support QOP
- Aligns with FFmpeg behavior and VDK library approach
- Fixes 401 authentication errors with multi-algorithm cameras
@ljhljh127
Copy link
Author

Problem

gortsplib prioritizes SHA256 digest authentication over MD5, but doesn't support QOP (Quality of Protection) parameters required by SHA256. This causes 401 authentication failures with cameras offering multiple digest algorithms.

Root Cause

Current algorithm selection logic always chooses SHA256 when available, regardless of QOP support:

(auth.Algorithm != nil && *auth.Algorithm == headers.AuthAlgorithmSHA256)

@aler9
Copy link
Member

aler9 commented Sep 3, 2025

Hello, prioritizing MD5 over SHA256 would create a security issue.

Can you write the manufacturer and model of the camera you're having trouble with?

Can you post a network dump or example of RTSP communications between the camera and a server?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants