Overview
Bitwarden Server requires SSL/TLS certificates for:- HTTPS traffic - Securing client-server communication
- Token signing - Identity Server token generation and validation
- Data protection - ASP.NET Core data protection keys
Certificate Types
Web Server Certificates
Used by Nginx/reverse proxy for HTTPS traffic.Format: PEM (
.crt + .key) or PFX (.pfx)Identity Server Certificates
Used for signing OAuth 2.0 / OpenID Connect tokens.Format: PFX with private key
Data Protection Certificates
Used by ASP.NET Core for encrypting cookies and tokens.Format: PFX with private key
Client Certificates
Optional mutual TLS authentication.Format: PFX or PEM
Obtaining Certificates
Let’s Encrypt (Recommended)
Free, automated SSL certificates:- Certbot
- Docker with Certbot
- Automatic Renewal
Commercial Certificate Authority
Purchase from trusted CAs like DigiCert, GlobalSign, or Sectigo:1
Generate CSR
2
Submit CSR to CA
Submit the
.csr file to your certificate authority and complete domain validation.3
Download Certificate
Download the signed certificate and intermediate certificates from your CA.
4
Create Certificate Chain
Self-Signed (Development Only)
For development and testing:Web Server Configuration
Nginx
Configure Nginx to use SSL certificates:nginx.conf
Docker Compose
Mount certificates in Docker Compose:docker-compose.yml
Identity Server Certificates
Identity Server requires a certificate for signing tokens:Generate Identity Server Certificate
Install Certificate
- Docker Volume
- Certificate Store (Linux)
- Windows Certificate Store
docker-compose.yml
Configure Services
appsettings.json
You can use the same certificate for both Identity Server and Data Protection, or separate certificates for enhanced security.
Certificate Rotation
Web Server Certificates
1
Obtain New Certificate
Generate or renew certificate using Let’s Encrypt or your CA.
2
Update Certificate Files
Replace old certificate files with new ones:
3
Reload Nginx
4
Verify
Identity Server Certificates
1
Generate New Certificate
Create new certificate and get thumbprint.
2
Install New Certificate
Install alongside old certificate (don’t remove old one yet).
3
Update Configuration
Update
certificateThumbprint in all service configurations.4
Rolling Restart
Restart services one at a time:
5
Remove Old Certificate
After all tokens have expired, remove the old certificate.
Security Best Practices
Use Strong Key Lengths
- Minimum 2048-bit RSA
- Recommended: 4096-bit RSA or ECC P-256
Enable HSTS
Add
Strict-Transport-Security header to force HTTPS:Disable Weak Protocols
- Disable SSLv3, TLS 1.0, TLS 1.1
- Use only TLS 1.2 and TLS 1.3
Monitor Expiration
Set up alerts for certificates expiring within 30 days.
Secure Private Keys
- Use strong file permissions (600 or 400)
- Never commit private keys to version control
- Consider Hardware Security Modules (HSM) for production
Use CAA Records
Add DNS CAA records to prevent unauthorized certificate issuance:
Troubleshooting
Certificate not found error
Certificate not found error
Symptoms:
Certificate with thumbprint 'ABC123' not foundSolutions:- Verify certificate is installed in correct store (LocalMachine\My on Windows)
- Check thumbprint matches (no spaces, correct case)
- Ensure private key is accessible
- Check file permissions on certificate files
SSL handshake errors
SSL handshake errors
Symptoms: Clients cannot establish HTTPS connectionSolutions:
- Verify certificate is valid (not expired)
- Check certificate chain is complete
- Ensure private key matches certificate
- Test with:
openssl s_client -connect domain:443
Token signature validation failed
Token signature validation failed
Symptoms: Login fails with invalid token signatureSolutions:
- Verify Identity Server certificate is configured correctly
- Check certificate has private key
- Ensure thumbprint in all services matches
- Restart services after certificate changes
Self-signed certificate warnings
Self-signed certificate warnings
Symptoms: Browser shows security warningsSolutions:
- For development: Add certificate to trusted root store
- For production: Use certificate from trusted CA
- Ensure certificate includes Subject Alternative Names (SAN)
Testing Certificates
Next Steps
Docker Deployment
Deploy services with SSL configured
Configuration
Configure certificate settings in appsettings.json
Security Best Practices
Additional security hardening
Troubleshooting
Resolve common issues