AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 822716
Accepted
Justas
Justas
Asked: 2016-12-27 02:12:34 +0800 CST2016-12-27 02:12:34 +0800 CST 2016-12-27 02:12:34 +0800 CST

用于存储库克隆的 Gitlab HTTPS URI 不起作用 - 无法验证 SSL 主机 - 致命:无法访问

  • 772

当我制作 Eclipse -> 文件 -> 导入 -> 项目 -> 来自 Git 的项目 -> 克隆 URI -> 从 Gitlab 输入存储库 HTTPS URI 时,出现错误:

可能原因:
URL 不正确
没有网络连接(例如代理设置错误)
SSL 主机无法验证(在 Git 配置中设置 http.sslVerify=false)

我已经http.sslVerify false在 Eclipse 配置中添加了,但它仍然无法正常工作。

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

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

Gitlab 生产日志显示:

Projects::GitHttpController#info_refs 作为 HTML
参数处理:{"service"=>"git-upload-pack", "namespace_id"=>"java", "project_id"=>"project.git"}
完成 500 内部服务器102 毫秒内出错(ActiveRecord:2.5 毫秒)
JWT::DecodeError(Nil JSON Web 令牌):
lib/gitlab/workhorse.rb:120:in 'verify_api_request!'
app/controllers/projects/git_http_client_controller.rb:154:in 'verify_workhorse_api!'
lib/gitlab/request_profiler/middleware.rb:15:in 'call'
lib/gitlab/middleware/go.rb:16:in 'call'

SSH URL 运行良好。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 '] = 假
独角兽['listen'] = '127.0.0.1'
独角兽['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 add 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.rbgitlab-workhorse 配置没有帮助。

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

如何解决这个问题呢?

ssl git apache-2.4 gitlab eclipse
  • 1 1 个回答
  • 6779 Views

1 个回答

  • Voted
  1. Best Answer
    Justas
    2016-12-29T00:50:33+08:002016-12-29T00:50:33+08:00

    在 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"

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

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

    nginx['启用'] = false

    这就是整个 gitlab.rb 配置,其他行注释。

    并proxyPass在/etc/apache2/apache2.conf9191 端口而不是 Unicorn 上工作的 gitlab-workhorse:

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

    • 0

相关问题

  • 如何使用 Tomcat 5.5 更新 SSL 证书

  • 为 IIS6 自行生成 SSL 证书?

  • plesk 上的域和子域 ssl 访问

  • 如何设置 SSL 邮件服务器?

  • 如何通过 SVN 命令行接受 SSL 证书?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve