搭建 gitlab 遇到 ssl 问题

2014-09-18 18:29:40 +08:00
 larkifly
搭建方式gitlab+nginx:

现在的情况是,nginx配置成http方式,可以通过ssh方式push代码,nginx配置成https方式,通过ssh方式push代码,就会出现如下错误:
/usr/local/lib/ruby/2.0.0/net/http.rb:918:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
from /usr/local/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
from /usr/local/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
from /usr/local/lib/ruby/2.0.0/net/http.rb:918:in `connect'
from /usr/local/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
from /usr/local/lib/ruby/2.0.0/net/http.rb:851:in `start'
from /home/git/gitlab-shell/lib/gitlab_net.rb:62:in `get'
from /home/git/gitlab-shell/lib/gitlab_net.rb:17:in `allowed?'
from /home/git/gitlab-shell/lib/gitlab_shell.rb:59:in `validate_access'
from /home/git/gitlab-shell/lib/gitlab_shell.rb:23:in `exec'
from /home/git/gitlab-shell/bin/gitlab-shell:16:in `<main>'

如果通过https push代码,就会出现fatal: could not read Username for 'https://git.******': No such file or directory

求大神指教
6680 次点击
所在节点    程序员
7 条回复
orzfly
2014-09-18 19:17:58 +08:00
都说了 certificate verify failed 了嘛……

https://github.com/gitlabhq/gitlab-shell/blob/master/config.yml.example#L16
这行改成 true 试试……
mhtt
2014-09-18 20:34:01 +08:00
同遇到过这个问题,处理办法是
把 `/home/git/gitlab/config/gitlab.yml` 里面的 https: true 同时修改端口 port: 443 (默认是80)
larkifly
2014-09-18 20:39:43 +08:00
@orzfly
@mhtt

好使了,但现在有个问题,
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

这个问题怎么解决啊
mengzhuo
2014-09-19 09:46:26 +08:00
@larkifly 请学好英语再学编程
larkifly
2014-09-19 10:24:16 +08:00
@mengzhuo 现在是linux能push,windows下出现这个错误
mengzhuo
2014-09-19 10:30:00 +08:00
windows 用git bash的话,你确定你的私钥能登入?
larkifly
2014-09-19 20:49:34 +08:00
@mengzhuo 私钥在http情况下能登入并且push,https不行,有没有可能是https的ssl证书是自己生成的,所以push的时候git检查这个ssl返回的错误了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/134307

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX