卷曲没有下载所需的文件

卷曲没有下载所需的文件

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

我该如何解决这个问题?

[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

是网络相关问题吗?

编辑:

[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:

[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:

[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:

 [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 ~]#

答案1

嗯,发现的问题与 MSS/MTU 有关。我需要在路由器上将 mss 值调整为 1452 来解决此问题。现在所有用户/服务器都没有这个问题。

答案2

重点是 Gitlab 不支持 sslv2 和 sslv3 任何moe(请参阅Qualys SSL 检查报告Gitlab 的配置 > 协议下)。您的curl、openssl 和wget 版本尝试使用过时的协议连接到服务器。

如果curl您可能会强制客户端改用 TLS。尝试以下选项:

--tlsv1
--tlsv1.1
--tlsv1.2
--sslv2 # this will not work on Gitlab
--sslv3 # this will not work on Gitlab

我假设您的操作系统是旧的或过时的。你应该更新你的系统。

相关内容