Tag Archives: curl: (56) Recv failure: Connection reset by peer

How to Solve Error: curl: (56) Recv failure: Connection reset by peer

Test environment issues:

Timeļ¼š2019-03-15 10:14:54
Mobile:159XXXX4799
Message:Time:2019.03.15 10:14:51 Hostname:Zabbix server Monitor item:Agent ping for Up (1) Message:Zabbix agent on Zabbix server is unreachable for 5 minutes,please Please deal with it in time.
Description: Problem: Zabbix agent on Zabbix server is unreachable for 5 minutes
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   348    0     0  100   348      0   4702 --:--:-- --:--:-- --:--:--  4702
curl: (56) Recv failure: Connection reset by peer
    ###2019-03-15 10:14:54:send closed---------------------

Later to curl Baidu page also can’t pass

[root@localhost ~]# curl www.google.com
curl: (56) Recv failure: Connection reset by peer

In the process of checking the problem, we found that it might be an HTTPS problem. Just add HTTPS

/tmp # curl -I https://google.com
HTTP/1.1 302 Moved Temporarily
Server: bfe/1.0.8.18
Date: Fri, 15 Mar 2019 02:38:07 GMT
Content-Type: text/html
Content-Length: 161
Connection: keep-alive
Location: http://www.google.com/

I got through…. Just add HTTPS to the interface address HTTP of the script