13

I am retrieving video from an IP-Camera using rtsp using a java web application; The rtsp url has embedded username/password in the url itself which seems to be quite insecure. e.g. rtsp://user:password@ip/...

Is there a way to to prevent sending the username/password in the URL.

What will be the best possible way to secure the URL?

Soumya
  • 1,833
  • 5
  • 34
  • 45

2 Answers2

5

Given a username and password, you can set them using environment variables like this:

USER=myusername
PASSWD=mypassword

For example, if your camera's IP address is 192.168.0.101, then you can access the camera via its RTSP URL:

rtsp://"${USER}":"${PASSWD}"@192.168.0.101:554
Frak
  • 832
  • 1
  • 11
  • 32
4

Username/password in the URL is a way to write url. Rtsp agent will use it to authenticate with basic or digest authentication. So your password will be encoded and transported as a rtsp header.

Trizalio
  • 811
  • 7
  • 16