【发布时间】:2018-12-17 06:49:02
【问题描述】:
我正在尝试使用 CURL 从一个特定的网站获取网页,但是它给出了这个错误:
curl -q -v -A "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" https://www.saiglobal.com/ --output ./Downloads/test.html
....
* SSL certificate verify ok.
} [5 bytes data]
> GET / HTTP/1.1
> Host: www.saiglobal.com
> User-Agent: Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
> Accept: */*
>
0 0 0 0 0 0 0 0 --:--:-- 0:11:53 --:--:-- 0* OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
* stopped the pause stream!
0 0 0 0 0 0 0 0 --:--:-- 0:11:53 --:--:-- 0
* Closing connection 0
} [5 bytes data]
curl: (56) OpenSSL SSL_read: SSL_ERROR_SYSCALL, errno 104
我不确定发生了什么。我找不到很多关于错误消息的有用信息。在我的 Mac 上,errorno 是 60 而不是 104。
但是,在这些机器上使用 Chrome 可以毫无问题地加载页面。其中一台机器的 CURL 版本是 7.58.0。
感谢任何帮助。
【问题讨论】:
-
".... 使用特定网站 SSL 证书" - 问题不在于 SSL 证书。 SSL 握手(这是唯一涉及证书的部分)在站点上成功完成,并且该错误仅在稍后发生。错误 104 是连接重置,即服务器出于某种未知原因关闭了连接。
-
谢谢,我也这么认为,并尝试使用 Google Bot 用户代理看看是否会有所作为。