在 Debian 上“测 Nginx 的 SSL”通常指下面几类事情之一,我按最常见场景给你说明,你可以对号入座。
sudo ss -tlnp | grep :443
# 或
sudo netstat -tlnp | grep :443
sudo nginx -T | grep -i ssl
常见应有:
listen 443 ssl;
ssl_certificate /path/to/fullchain.pem;
ssl_certificate_key /path/to/privkey.pem;
sudo nginx -t
openssl s_client -connect localhost:443
如果看到:
Verify return code: 0 (ok)说明 SSL 正常工作。
curl -I https://localhost --insecure
或看证书:
curl -vI https://localhost --insecure
curl -I https://yourdomain.com
openssl s_client -connect yourdomain.com:443 -servername yourdomain.com
nmap --script ssl-enum-ciphers -p 443 localhost
在 Nginx 中应有:
ssl_protocols TLSv1.2 TLSv1.3;
sudo journalctl -u nginx -e
sudo ls -l /etc/ssl/certs/yourcert.pem
sudo certbot certificates
sudo certbot renew --dry-run
如果你能告诉我:
我可以直接给你针对性的命令和配置示例。