bash
# Check PEM/CRT certificate
openssl x509 -in certificate.crt -noout -dates
# Check JKS certificate
keytool -list -v -keystore keystore.jks -storepass <password>
Open the certificate file directly in browser to view validity period and issuer.
bash
# Check Nginx certificate (port 443)
echo "" | openssl s_client -connect domain:443 -servername domain 2>/dev/null | openssl x509 -noout -dates
# Check game server JKS certificate (port +3 offset)
echo "" | openssl s_client -connect game.domain:port+3 2>/dev/null | openssl x509 -noout -dates
Applicable to: Web services, reverse proxies, CDN frontends, and any Nginx-hosted SSL termination.
1. Replace certificate files
Login to target server, replace files in /etc/nginx/ssl/:
.crt).key)2. Validate configuration
bash
nginx -t
3. Reload Nginx
bash
nginx -s reload
4. Verify the update Send HTTP/HTTPS request to confirm the new certificate is being served.
5. Update certificate monitoring records Login to ops backend → Asset Management → Domain Assets → Domain Monitoring → Add record → Upload new certificate.
6. Commit to version control
⚠️ 禁止将
.key私钥文件提交到版本库。私钥应保留在服务器安全路径(如/etc/nginx/ssl/)或密钥管理系统中。仅提交证书文件(.crt)或元数据。
Submit updated certificates to the version control repository.
RoleScopeOps/InfraReplace Nginx certificates, validate, reload, update monitoringThird-party vendorCloud services, load balancers, middleware certificates
Applicable to: Java-based game servers that use JKS (Java KeyStore) format certificates.
text
Ops provides certificate and private key
↓
Dev team compiles into Java certificate (JKS)
↓
Ops uploads JKS to ops server
↓
Game server auto-replaces on next update
↓
Verify: request game server domain on port+3
bash
keytool -list -v -keystore game.jks -storepass <password>
Applicable to: Self-managed services using Let's Encrypt certificates (e.g., internal tools, dev environments, small-scale deployments).
bash
# Install certbot with DNS plugin (Alibaba Cloud example)
yum install -y certbot-dns-aliyun
# Configure Alibaba Cloud CLI authentication
# Reference: https://help.aliyun.com/zh/cli/configure-credentials
# Apply for wildcard certificate
certbot certonly \
--manual \
--preferred-challenges dns \
--dns-aliyun \
-d "*.example.com" \
-d "example.com"
For other DNS providers, use the corresponding plugin:
certbot-dns-cloudflarecertbot-dns-route53--manual --preferred-challenges dnsbash
# Switch to cert directory
cd /etc/letsencrypt
# Generate DH parameters (enhanced security)
openssl dhparam -out dhparam.pem 2048
# Add SSL configuration
vim /etc/letsencrypt/options-ssl-nginx.conf
# Configure Nginx
# ... add ssl_certificate, ssl_certificate_key, etc. ...
# Reload Nginx
nginx -s reload
bash
# Set up cron job (runs every 2 days)
crontab -e
# 0 0 */2 * * certbot renew --deploy-hook "/root/your-hook.sh"
# Manual dry-run (doesn't actually renew)
certbot renew --dry-run
Note: Let's Encrypt certificates are valid for 90 days. certbot renew only actually renews within 30 days of expiry.
Emergency: Certificate expired, business impacted (e.g., payments failing, users locked out).
Immediate actions:
openssl s_client -connect domain:443nginx -s reloadPrevention:
ItemTypeRenewalNotesProject certificate (purchased)Commercial CAVendor/Third-partyContact issuer directlyJKS certificateJava KeyStoreDev team compilesOps uploads to serverLet's EncryptACMEcertbot auto-renewal90-day validityWildcard certificateDNS-validatedcertbot with DNS pluginRequired for *.domain.com
bash
# Check certificate validity
openssl x509 -in cert.crt -noout -dates
# Check JKS certificate
keytool -list -v -keystore game.jks
# Nginx config test
nginx -t
# Reload Nginx
nginx -s reload
# Apply Let's Encrypt (DNS challenge)
certbot certonly --manual --preferred-challenges dns -d "*.domain.com"
# Auto-renewal dry-run
certbot renew --dry-run
# Check remote certificate
echo "" | openssl s_client -connect domain:443 -servername domain 2>/dev/null | openssl x509 -noout -dates
/etc/letsencrypt/live/domain/