RTSP stream over SSL with nginx

Viewed 5208

for security purposes I want to encrypt the RTSP stream of a camera before sending the data in the world. For this I have set up a NGINX server with a SSL encryption:

nginx.conf:

stream {
  upstream rtsp_backend {
    server                 10.0.1.1:554; #my dahua camera
    #server                  184.72.239.149:554; #big buck bunny stream
}
server {
    listen                  12345 ssl;
    proxy_pass              rtsp_backend; 
    ssl_certificate         /etc/nginx/dev_nginx.chain.crt;
    ssl_certificate_key     /etc/nginx/dev_nginx.key;        
}

I test my configuration with ffplay command:

ffplay -rtsp_transport tcp rtsps://user:password@127.0.0.1:12345/live

This configuration works fine with the buck bunny stream - the stream is encrypted between nginx and ffplay. And it works also fine when I create a rtsp stream by myself with ffmpeg/ffserver.

BUT: the problem is now my real use case with the camera Dahua (IPC-HFW1431S). FFPLAY tells me:

[tls @ 0x7f7f18002e80] No default whitelist set
[tcp @ 0x7f7f18003420] No default whitelist set
[rtsp @ 0x7f7f18000b80] method OPTIONS failed: 404 Not Found

So the request for the options (SDP) fails with file not found. When I remove the ssl statements of nginx, everything is fine. What am I missing? Everything works fine without SSL. The only difference between the camera and the other RTSP streams is the authentication. But this seems to be ok, because this is done before OPTIONS request and it succeeds.

0 Answers
Related