WebTransport is a modern protocol that enables low-latency, bidirectional communication between clients and servers. The MOQtail relay server uses WebTransport over QUIC, which requires proper SSL/TLS certificate configuration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/moqtail/moqtail/llms.txt
Use this file to discover all available pages before exploring further.
Understanding WebTransport Requirements
WebTransport has strict security requirements:- HTTPS/TLS is mandatory - No plain text connections allowed
- Valid certificates required - Browsers verify certificate chains
- UDP protocol - Uses QUIC (UDP-based) instead of TCP
- Browser support - Currently best supported in Chrome/Chromium
Development Setup
For local development, usemkcert to generate trusted self-signed certificates.
Installing mkcert
Install local Certificate Authority
This creates and installs a local CA in your system trust store:You should see output like:
Generate certificates for localhost
Navigate to the relay certificate directory:Generate certificates for localhost and common local addresses:This creates two files:
cert.pem- Public certificatekey.pem- Private key
The default relay configuration expects these files at
apps/relay/cert/cert.pem and apps/relay/cert/key.pem.Custom Domains and IP Addresses
To support additional domains or IP addresses:Browser Configuration
Chrome/Chromium (Recommended)
Chrome has the best WebTransport support and requires enabling developer mode for self-signed certificates.Enable WebTransport Developer Mode
- Open Chrome and navigate to:
- Find “WebTransport Developer Mode”
- Set to “Enabled”
- Click “Relaunch” to restart Chrome
WebTransport Developer Mode allows connections to servers with certificates signed by untrusted CAs. This is essential for development with mkcert but should never be used in production.
Firefox
For Firefox (experimental):- Navigate to
about:config - Search for
network.webtransport.enabled - Set to
true - Accept the warning
Edge
Edge uses the same Chromium engine as Chrome, so similar flags should be available at:Safari
WebTransport is not yet supported in Safari.Production Setup
For production deployments, use certificates from a trusted Certificate Authority.Let’s Encrypt with Certbot
Configure relay with Let's Encrypt certificates
Certificates are typically stored at:Run the relay with these certificates:
Certificate Requirements
Your production certificates must:- Be PEM-encoded - MOQtail expects PEM format
- Include full chain - Certificate + intermediate certificates
- Match the domain - Certificate CN/SAN must match relay domain
- Be currently valid - Not expired or not yet valid
- Use supported algorithms - RSA 2048+ or ECDSA P-256+
Converting Certificate Formats
If you have certificates in other formats:Verifying Your Setup
Test Certificate Installation
Verify the relay can load your certificates:Inspect Certificate Details
Test WebTransport Connection
Create a simple test HTML file:test.html
Firewall Configuration
WebTransport uses UDP, not TCP. Ensure your firewall allows UDP traffic:Cloud Provider Security Groups
AWS Security Group:Troubleshooting
WebTransport connection fails
WebTransport connection fails
Symptoms:Solutions:
- Verify mkcert CA is installed:
mkcert -CAROOT - Enable WebTransport Developer Mode in Chrome
- Check certificate includes the domain/IP you’re connecting to
- Restart browser after enabling developer mode
Certificate verification failed
Certificate verification failed
Error:Solutions:
Connection works locally but not remotely
Connection works locally but not remotely
Possible causes:
- Certificate doesn’t include remote IP/domain
- Firewall blocking UDP traffic
- Server bound to localhost instead of 0.0.0.0
Browser reports WebTransport not available
Browser reports WebTransport not available
Check:If returns
false:- Update to latest Chrome (version 97+)
- Enable
chrome://flags/#webtransport-developer-mode - Try Chrome Canary for cutting-edge support
- Firefox and Safari don’t fully support WebTransport yet
Security Best Practices
Development
✅ Do:- Use mkcert for local development certificates
- Enable WebTransport Developer Mode only in development
- Keep certificates in
apps/relay/cert/(gitignored) - Regenerate certificates if you add new domains/IPs
- Commit private keys to version control
- Share mkcert CA root certificate
- Use self-signed certificates in production
- Disable certificate validation in production code
Production
✅ Do:- Use certificates from trusted CAs (Let’s Encrypt, DigiCert, etc.)
- Implement automatic certificate renewal
- Monitor certificate expiration dates
- Use certificate pinning for critical applications
- Keep private keys secure (mode 600, encrypted storage)
- Use separate certificates per environment
- Use self-signed certificates
- Share certificates across environments
- Commit production certificates to repositories
- Use weak key sizes (< 2048 bits RSA)
Code Reference
The relay loads certificates using the wtransport library:apps/relay/src/server/config.rs:117
Next Steps
Relay Server Configuration
Configure advanced relay server options
Connect Clients
Connect WebTransport clients to your relay