Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

Nginx peer closed connection in SSL handshake while SSL handshaking

I got this error message when configured SSL in nginx.

*15 peer closed connection in SSL handshake while SSL handshaking, client: 98.158.245.100, server: 0.0.0.0:443 Below is my SSL config file:

server {
    listen  443 ssl;
    server_name  mydomain.cn;

    ssl_certificate      D:/Applications/nginx-1.15.6/ssl/esign/mydomain.pem;
    ssl_certificate_key  D:/Applications/nginx-1.15.6/ssl/esign/mydomain.key;

    proxy_ssl_server_name on;
    proxy_ssl_session_reuse off;

    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;

    ssl_protocols        TLSv1.2;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;
    
    default_type 'text/html';

    location / {
        proxy_pass https://153.152.123.492;
    }       
}
question from:https://stackoverflow.com/questions/65876849/nginx-peer-closed-connection-in-ssl-handshake-while-ssl-handshaking

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

check if your upstream server has the certificate as well.

check the clients protocols because you provide support only for TLSv1.2 pass some more headers to your upstream

try

ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;

try adding support for http2 to eliminate continues handshaking if nginx was compiled with it, like so

listen  443 ssl http2;

it would be helpfull though looking at your upstream logs as well, maybe for a 502


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...