Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set username/password in rtsp url

Tags:

rtsp

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?

like image 549
Soumya Avatar asked Dec 01 '14 07:12

Soumya


2 Answers

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.

like image 77
Trizalio Avatar answered Oct 10 '22 06:10

Trizalio


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
like image 24
frakman1 Avatar answered Oct 10 '22 05:10

frakman1