nginx 的 ssl 配置如下:
server {
listen 443;
server_name ***
ssl_certificate /etc/nginx/certs/***.pem;
ssl_certificate_key /etc/nginx/certs/***.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
curl 命令请求错误如下
curl: (35) LibreSSL/3.3.6: error:1404B42E:SSL routines:ST_CONNECT:tlsv1 alert protocol version
通过园子的博文 nginx-ERR_SSL_PROTOCOL_ERROR出现的原因以及解决办法 找到了原因——没有启用 ssl,启用方法:
listen 443
改为 listen 443 ssl
ssl on