首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >curl不下载所需的文件

curl不下载所需的文件
EN

Unix & Linux用户
提问于 2018-08-31 08:09:16
回答 2查看 2.4K关注 0票数 2

我无法下载GitLab的bash脚本。不过,我可以在浏览器中打开链接。

我怎么才能解决这个问题?

代码语言:javascript
复制
[root@localhost ~]# curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:39 --:--:--     0

是网络相关的问题吗?

编辑:

代码语言:javascript
复制
[root@localhost ~]# curl -v https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* About to connect() to packages.gitlab.com port 443 (#0)
*   Trying 54.153.54.194...
* Connected to packages.gitlab.com (54.153.54.194) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
  0     0    0     0    0     0      0      0 --:--:--  0:02:00 --:--:--     0* NSS error -5961 (PR_CONNECT_RESET_ERROR)
* TCP connection reset by peer
  0     0    0     0    0     0      0      0 --:--:--  0:02:01 --:--:--     0
* Closing connection 0
curl: (35) TCP connection reset by peer

编辑-2:

代码语言:javascript
复制
[root@localhost ~]# openssl s_client -connect packages.gitlab.com:443 -state -nbio
CONNECTED(00000003)
turning on non blocking io
SSL_connect:before/connect initialization
SSL_connect:SSLv2/v3 write client hello A
SSL_connect:error in SSLv2/v3 read server hello A
write R BLOCK
^C
[root@localhost ~]#

编辑-3:

代码语言:javascript
复制
[root@localhost ~]# wget  https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
--2018-08-31 06:09:29--  https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh
Resolving packages.gitlab.com (packages.gitlab.com)... 54.153.54.194
Connecting to packages.gitlab.com (packages.gitlab.com)|54.153.54.194|:443... connected.
^C
[root@localhost ~]# clock
Fri 31 Aug 2018 06:13:51 AM EDT  -0.850009 seconds

编辑-4:

代码语言:javascript
复制
 [root@localhost ~]# curl -v --tlsv1 https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* About to connect() to packages.gitlab.com port 443 (#0)
 *   Trying 54.153.54.194...
 * Connected to packages.gitlab.com (54.153.54.194) port 443 (#0)
 * Initializing NSS with certpath: sql:/etc/pki/nssdb
 *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
   CApath: none
   0     0    0     0    0     0      0      0 --:--:--  0:02:00 --:--:--     0* NSS error -5961 (PR_CONNECT_RESET_ERROR)
 * TCP connection reset by peer
   0     0    0     0    0     0      0      0 --:--:--  0:02:01 --:--:--     0
 * Closing connection 0
 curl: (35) TCP connection reset by peer
 [root@localhost ~]# curl -v --tlsv1.1 https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* About to connect() to packages.gitlab.com port 443 (#0)
 *   Trying 54.153.54.194...
 * Connected to packages.gitlab.com (54.153.54.194) port 443 (#0)
 * Initializing NSS with certpath: sql:/etc/pki/nssdb
 *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
   CApath: none
   0     0    0     0    0     0      0      0 --:--:--  0:02:00 --:--:--     0* NSS error -5961 (PR_CONNECT_RESET_ERROR)
 * TCP connection reset by peer
   0     0    0     0    0     0      0      0 --:--:--  0:02:01 --:--:--     0
 * Closing connection 0
 curl: (35) TCP connection reset by peer
 [root@localhost ~]# curl -v --tlsv1.2 https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash
   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                  Dload  Upload   Total   Spent    Left  Speed
   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* About to connect() to packages.gitlab.com port 443 (#0)
 *   Trying 54.153.54.194...
 * Connected to packages.gitlab.com (54.153.54.194) port 443 (#0)
 * Initializing NSS with certpath: sql:/etc/pki/nssdb
 *   CAfile: /etc/pki/tls/certs/ca-bundle.crt
   CApath: none
   0     0    0     0    0     0      0      0 --:--:--  0:02:00 --:--:--     0* NSS error -5961 (PR_CONNECT_RESET_ERROR)
 * TCP connection reset by peer
   0     0    0     0    0     0      0      0 --:--:--  0:02:01 --:--:--     0
 * Closing connection 0
 curl: (35) TCP connection reset by peer
 [root@localhost ~]#
EN

回答 2

Unix & Linux用户

回答已采纳

发布于 2018-09-04 10:56:43

所确定的问题与MSS/MTU有关。我需要在路由器上将mss值调整为1452来修复这个问题。现在所有的用户/服务器都没有这个问题。

票数 2
EN

Unix & Linux用户

发布于 2018-08-31 10:25:41

重点是Gitlab不支持sslv2和sslv3 anymoe (参见配置>协议下的Gitlab的Qualys检查器报告 )。您的curl、openssl和wget版本试图用过时的协议连接到服务器。

在发生curl的情况下,您可能会强迫客户端使用TLS。尝试以下选项:

代码语言:javascript
复制
--tlsv1
--tlsv1.1
--tlsv1.2
--sslv2 # this will not work on Gitlab
--sslv3 # this will not work on Gitlab

我想你的操作系统是旧的还是过时的。你应该更新你的系统。

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/465954

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档