Nginx SSL 握手错误的定位与修复
error.log 出现 SSL_do_handshake() failed、no shared cipher、wrong version number、certificate verify failed;客户端无法建立 HTTPS 连接。
tail -f /var/log/nginx/error.log
nginx -T | grep -nE 'ssl_certificate|ssl_protocols|ssl_ciphers|ssl_verify_client'
openssl s_client -connect <host>:443 -servername <host>
openssl x509 -in cert.pem -noout -dates -subject -issuer
s_client 看握手停在哪一步和返回的 alert。ssl_protocols/ssl_ciphers,兼顾安全与客户端兼容。server_name。ssl_client_certificate 和 ssl_verify_client。nginx -t 再 reload,并用多种客户端验证。nginx — SSL 配置openssl — 握手与证书检查curl — HTTPS 验证