How to fix SSL_do_hadshake failed in Nginx

If you receive a lot of failed SSL from an error log on your Nginx server, you probably recently migrated into a new server and uses the previous SSL certificate which is fine. But for some reason , this causes an issue that will fail the SSL_do_handshake when you try connecting to your website.

An example error log below shows the problem.

2021/02/12 03:16:11 [info] 80295#80295: *893 client closed connection while SSL handshaking, client: 52.56.255.25, server: 0.0.0.0:443
2021/02/12 03:17:11 [info] 80403#80403: *69 recv() failed (104: Connection reset by peer) while SSL handshaking, client: 203.170.12.10, server: 0.0.0.0:443
2021/02/12 03:23:43 [info] 80515#80515: *540 client closed connection while SSL handshaking, client: 110.93.83.45, server: 0.0.0.0:443
2021/02/12 03:28:37 [info] 80515#80515: *1931 client closed connection while SSL handshaking, client: 139.193.70.113, server: 0.0.0.0:443
2021/02/12 03:30:17 [info] 80515#80515: *2277 SSL_do_handshake() failed (SSL: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:SSL alert number 42) while SSL handshaking, client: 64.71.131.244, server: 0.0.0.0:443
2021/02/12 03:30:17 [info] 80515#80515: *2278 SSL_do_handshake() failed (SSL: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:SSL alert number 42) while SSL handshaking, client: 64.71.131.244, server: 0.0.0.0:443
2021/02/12 03:31:59 [info] 80515#80515: *2605 client closed connection while waiting for request, client: 173.252.127.111, server: 0.0.0.0:443
2021/02/12 03:32:34 [info] 80515#80515: *2700 client closed connection while SSL handshaking, client: 35.157.91.171, server: 0.0.0.0:443

In order to fix this error, you just need to request a new certificate for your website.

sudo certbot --nginx -d yourwebsite.com -d www.yourwebsite.com

After that, you will no longer receive the problem on your error log making your server.

Leave a Comment

trabzon escort yalova escort Samsun escort izmit escort nazilli escort