无法与 wget 建立 SSL 连接

无法与 wget 建立 SSL 连接

我正在尝试执行:

wget https://app.adroll.com/api/v1/export/all_campaigns_report?advertisable=T4ZPAGYESJEZZMCCBVEMHK&reports=AllCampaignsSummary,AllCampaignsChart,AllAds,AllCampaignsSites&format=csv&currency=USD

我在我的 centos 机器上将 wget 1.12 替换为 1.16。

我已经将check-certificate选项设置off

vi /etc/wgetrc

我通常可以使用httpswget

wget https://google.com

它没有给出 google.com 的 SSL 错误。

事实上,我可以在浏览器上正常访问该链接。那么为什么使用 wget 似乎会失败呢?

通过此命令,我得到:

[root@warehouse ~]# wget 'https://app.adroll.com/api/v1/export/all_campaigns_report?advertisable=T4ZPAGYESJEZZMCCBVEMHK&reports=AllCampaignsSummary,AllCampaignsChart,AllAds,AllCampaignsSites&format=csv&currency=USD'
[2] 1487
[3] 1488
[4] 1489
[3]   Done                    reports=AllCampaignsSummary,AllCampaignsChart,AllAds,AllCampaignsSites
[root@warehouse ~]# --2016-10-06 18:27:48--  https://app.adroll.com/api/v1/export/all_campaigns_report?advertisable=T4ZPAGYESJEZZMCCBVEMHK
Resolving app.adroll.com (app.adroll.com)... 52.11.56.178, 52.89.249.63
Connecting to app.adroll.com (app.adroll.com)|52.11.56.178|:443... connected.
Unable to establish SSL connection.

编辑:尝试使用单引号和双引号。没有区别:

[root@warehouse ~]# wget 'https://app.adroll.com/api/v1/export/all_campaigns_report?advertisable=T4ZPAGYESJEZZMCCBVEMHK&reports=AllCampaignsSummary,AllCampaignsChart,AllAds,AllCampaignsSites&format=csv&currency=USD'
--2016-10-06 18:32:38--  https://app.adroll.com/api/v1/export/all_campaigns_report?advertisable=T4ZPAGYESJEZZMCCBVEMHK&reports=AllCampaignsSummary,AllCampaignsChart,AllAds,AllCampaignsSites&format=csv&currency=USD
Resolving app.adroll.com (app.adroll.com)... 52.89.249.63, 52.11.56.178
Connecting to app.adroll.com (app.adroll.com)|52.89.249.63|:443... connected.
Unable to establish SSL connection.

编辑2:也尝试使用--no-check-certificate:

[root@warehouse ~]# wget --no-check-certificate "https://app.adroll.com/api/v1/export/all_campaigns_report?advertisable=T4ZPAGYESJEZZMCCBVEMHK&reports=AllCampaignsSummary,AllCampaignsChart,AllAds,AllCampaignsSites&format=csv&currency=USD"
--2016-10-06 18:35:23--  https://app.adroll.com/api/v1/export/all_campaigns_report?advertisable=T4ZPAGYESJEZZMCCBVEMHK&reports=AllCampaignsSummary,AllCampaignsChart,AllAds,AllCampaignsSites&format=csv&currency=USD
Resolving app.adroll.com (app.adroll.com)... 52.11.56.178, 52.89.249.63
Connecting to app.adroll.com (app.adroll.com)|52.11.56.178|:443... connected.
Unable to establish SSL connection.

编辑3:

using  curl -v "https://app.adroll.com/api/v1/export/all_campaigns_report?a‌​dvertisable=T4ZPAGYE‌​SJEZZMCCBVEMHK&repor‌​ts=AllCampaignsSumma‌​ry,AllCampaignsChart‌​,AllAds,AllCampaigns‌​Sites&format=csv&cur‌​rency=USD" 
* About to connect() to app.adroll.com port 443 (#0)
*   Trying 52.11.56.178... connected
* Connected to app.adroll.com (52.11.56.178) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* NSS error -5938
* Closing connection #0
* SSL connect error
curl: (35) SSL connect error

答案1

您可以连接到服务器,如该行所示* Connected to app.adroll.com (52.11.56.178) port 443 (#0) (不包括防火墙和/或路由问题),但随后连接被切断,如 NSS 错误代码* NSS error -5938 * Closing connection #0和所示curl: (35) SSL connect error

通常您需要查看服务器端日志才能知道确切的原因,但@Anubioz 似乎有正确的想法,服务器阻止了您的连接尝试。

你可能违反了他们的无效流量如果您从特定的 IP 地址范围连接,则会受到保护。

“任何被认定为无效流量来源的域名都将被永久封锁。”

相关内容