Overview
SSL/TLS encryption is essential for securing Ant Media Server communications. It protects:
- REST API credentials and tokens
- WebRTC signaling
- HLS and DASH stream delivery
- Management dashboard access
Ant Media Server provides automated SSL configuration through the SslConfigurator class.
SSL Configuration Types
The SslConfigurator (security/SslConfigurator.java:12) supports three configuration methods:
1. Custom Domain with Let’s Encrypt
Automatically obtain SSL certificates from Let’s Encrypt for your domain:
2. Ant Media Subdomain
Use a free subdomain provided by Ant Media Server:
3. Custom Certificate
Use your own SSL certificate files:
See security/SslConfigurator.java:22-43 for the implementation.
Enabling SSL via Web Interface
Using Dashboard
- Navigate to Settings > SSL Certificate
- Choose configuration type:
- Let’s Encrypt: Enter your domain name
- Custom Certificate: Upload certificate files
- Click Enable SSL
- Wait for certificate installation
- Server will restart automatically
Enabling SSL via Command Line
Let’s Encrypt with Custom Domain
Requirements:
- Domain name pointing to your server’s IP
- Port 80 and 443 accessible
- Valid email address
Ant Media Subdomain
Get a free {servername}.antmedia.cloud subdomain:
The script will:
- Register your server
- Create a subdomain
- Obtain SSL certificate
- Configure Ant Media Server
Custom Certificate
Use your existing SSL certificates:
Required files:
- fullchain.pem: Full certificate chain
- privkey.pem: Private key
- chain.pem: Intermediate certificates
Certificate Components
The SslConfigurator requires specific certificate files:
Full Chain File
Contains:
- Your domain certificate
- Intermediate certificates
- Root certificate
Private Key File
Your domain’s private key. Keep this file secure!
Chain File
Intermediate and root certificates.
See security/SslConfigurator.java:53-63 for setters.
SSL Configuration Process
The getCommand() method (security/SslConfigurator.java:22-43) generates the appropriate command:
Verifying SSL Installation
Check HTTPS Access
Test the dashboard:
Expected response:
Check WSS WebSocket
Test WebRTC signaling:
Verify Certificate Details
Check:
- Certificate chain is complete
- Certificate is not expired
- Common Name (CN) matches your domain
- No certificate errors
Browser Verification
- Open
https://yourdomain.com:5443
- Click the padlock icon
- Verify:
- Connection is secure
- Certificate is valid
- Issued to your domain
Certificate Renewal
Automatic Renewal (Let’s Encrypt)
Let’s Encrypt certificates expire after 90 days. Ant Media Server sets up automatic renewal:
Manual renewal:
Custom Certificate Renewal
For custom certificates:
- Obtain new certificate from your CA
- Run SSL configuration again:
- Restart Ant Media Server
Ports and Firewall
Required Ports
Firewall Configuration
UFW (Ubuntu)
iptables
firewalld (CentOS/RHEL)
Security Best Practices
Always use SSL/TLS in production environments. Unencrypted connections expose sensitive data including authentication tokens and stream content.
Protect your private key file with strict permissions (chmod 600). Never commit private keys to version control or share them publicly.
Use strong cipher suites and disable older protocols like SSLv3 and TLS 1.0. Modern browsers require TLS 1.2 or higher.
Monitor certificate expiration dates and set up renewal alerts. Expired certificates will break all HTTPS/WSS connections.
Use Certificate Transparency monitoring to detect unauthorized certificate issuance for your domain.
Troubleshooting
Certificate Installation Failed
Common issues:
-
Port 80/443 not accessible
- Check firewall rules
- Verify no other service is using these ports
- Ensure domain points to server IP
-
Domain validation failed
- Verify DNS A record points to server
- Wait for DNS propagation (up to 48 hours)
- Check domain is not behind CDN/proxy
-
Permission denied
- Run script with sudo
- Check file permissions on certificate directory
Certificate Not Trusted
-
Chain incomplete
- Include all intermediate certificates
- Use full chain file, not just domain certificate
-
Wrong certificate for domain
- Verify Common Name matches domain
- Check Subject Alternative Names
-
Certificate expired
- Renew certificate
- Check system time is correct
Mixed Content Warnings
When embedding players:
All resources must use HTTPS when page is served over HTTPS.
WebRTC Connection Fails
-
Certificate validation failed
- Browser doesn’t trust certificate
- Install intermediate certificates
-
WSS connection refused
- Check port 5443 is open
- Verify WebSocket is using wss:// not ws://
-
STUN/TURN over TLS
- Configure TURN server with TLS
- Use port 443 for TURN-TLS
Using with WebRTC
JavaScript Client
Update WebSocket URL to use WSS:
Mobile SDKs
Android
iOS
Advanced Configuration
Custom SSL Settings
Edit Ant Media Server configuration:
Update SSL connector:
HSTS (HTTP Strict Transport Security)
Force HTTPS for all connections:
Next Steps