用于存储库克隆的Gitlab HTTPS URI不起作用 – 无法validationSSL主机 – 致命:无法访问

当我从Eclipse中创buildEclipse – >文件 – >导入 – >项目 – >项目 – >克隆URI – >从Gitlabinputrepository HTTPS URI时,出现错误:

可能的原因:
url不正确
没有networking连接(例如错误的代理设置)
SSL主机无法validation(在Gitconfiguration中设置http.sslVerify = false)

我在Eclipseconfiguration中添加了http.sslVerify false ,但它仍然不起作用。

如果我在cmd中使git clone https://my.example.com/gitlab/root/repository.git ,我得到:

克隆到“存储库”…
致命:无法访问“ https://my.example.com/gitlab/root/repository.git ”:请求的URL返回错误:500

Gitlab生产日志显示:

按项目处理:: GitHttpController#info_refs为HTML
参数:{“service”=>“git-upload-pack”,“namespace_id”=>“java”,“project_id”=>“project.git”}
在102ms内完成500个内部服务器错误(ActiveRecord:2.5ms)
JWT :: DecodeError(无JSON Web令牌):
lib / gitlab / workhorse.rb:120:在'verify_api_request!'中
app / controllers / projects / git_http_client_controller.rb:154:在'verify_workhorse_api!'中
lib / gitlab / request_profiler / middleware.rb:15:在'call'
lib / gitlab / middleware / go.rb:16:在`call'

SSHurl很好。 Gitlab与Apache2和HTTPS一起使用。 /etc/gitlab/gitlab.rb包含:

external_url'https: //my.example.com/gitlab '
web_server ['username'] ='apache'#'gitlab-www'
web_server ['group'] ='apache'#'gitlab-www'
nginx ['enable'] = false
独angular兽['listen'] ='127.0.0.1'
独angular兽['port'] = 9099

/etc/apache2/apache2.conf包含:

ProxyPass / gitlab http://127.0.0.1:9099/gitlab
ProxyPassReverse / gitlab http://127.0.0.1:9099/gitlab
RequestHeader添加X-Forwarded-Proto https

使用的版本:

GitLab 8.14.5
GitLab Shell 4.0.3
GitLab Workhorse 1.1.1
GitLab API v3
Git 2.7.4

有关于类似问题的文章通过GitLab上的HTTPS克隆修复问题,但修改/etc/gitlab/gitlab.rb gitlab-workhorseconfiguration没有帮助。

类似的问题: 使用HTTP(S)和Apache作为反向代理的git操作出现错误500

如何解决这个问题呢?

在9191端口启用了gitlab-workhorse:

external_url'https: //my.example.com/gitlab '

gitlab_workhorse ['enable'] = true
gitlab_workhorse ['listen_network'] =“tcp”
gitlab_workhorse ['listen_addr'] =“127.0.0.1:9191”

独angular兽['listen'] ='127.0.0.1'
独angular兽['port'] = 9099

web_server ['external_users'] = ['www-data']
web_server ['username'] ='apache'#'gitlab-www'
web_server ['group'] ='apache'#'gitlab-www'

nginx ['enable'] = false

这是整个gitlab.rbconfiguration,其他行被评论。

然后在/etc/apache2/apache2.conf中将proxyPass传递给工作在9191端口而不是Unicorn上的gitlab-workhorse:

ProxyPass / gitlab http://127.0.0.1:9191/gitlab
RequestHeader添加X-Forwarded-Proto“https”
RequestHeader设置X-Forwarded-Ssl