SmartRTSP
Languages · English

RTSP vs RTSPS: TLS, Port 322 and Camera Setup

RTSPS uses TLS to protect the RTSP control connection. If the camera and player carry audio and video inside that same TLS connection, those tracks are protected there too.

What TLS protects

If the device sends RTP media on a separate connection, verify the protection of that media transport separately. Support depends on how the camera and player negotiate the stream.

Which port to use

The standard default is TCP 554 for rtsp:// and TCP 322 for rtsps://. A camera or recorder can use a different configured port. Copy the documented secure URL with the correct host, port and path.

rtsps://CAMERA_HOST:322/STREAM_PATH

Ubiquiti lists TCP 7441 for RTSPS output from UniFi Protect. Use the port shown in the URL Protect generates.

Find the UniFi Protect stream URL

Check the certificate and test playback

Use the host name covered by the device’s certificate. Check the device and player clocks and use a certificate chain your player trusts. For a private CA, follow the device and player documentation to install the trusted certificate.

Test locally with a player that supports the documented RTSPS configuration. If the connection fails, check the host, port and whether TLS is enabled before troubleshooting the video codec.

Test the RTSPS certificate with OpenSSL

On a computer that can reach the camera, use OpenSSL 3. Replace CAMERA_HOST or CAMERA_IP and PORT with the values from your RTSPS address. For IPv6, use square brackets around the address in -connect only. The check uses no camera credentials.

openssl s_client -connect CAMERA_HOST:PORT -servername CAMERA_HOST -verify_hostname CAMERA_HOST -verify_return_error -brief
openssl s_client -connect CAMERA_IP:PORT -verify_ip CAMERA_IP -verify_return_error -brief
Verification: OK
TLS and the certificate verified in OpenSSL. Now try the complete RTSPS URL in your player to check video and audio.
hostname mismatch / IP address mismatch
Use the exact hostname or IP address covered by the certificate. If you need to use an IP address, the certificate must list that IP address.
unable to get local issuer certificate
Check that the server supplies any required intermediate certificates. For a private CA you trust, add -CAfile and the path to its certificate file.
Connection refused
Check the host, the configured RTSPS port and whether the device has enabled RTSPS.

OpenSSL s_client

Download SmartRTSP

Open your camera or test stream on your device.