V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
larkifly
V2EX  ›  程序员

搭建 gitlab 遇到 ssl 问题

  •  
  •   larkifly · 2014-09-18 18:29:40 +08:00 · 6578 次点击
    这是一个创建于 3517 天前的主题,其中的信息可能已经有所发展或是发生改变。
    搭建方式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

    求大神指教
    7 条回复    2014-09-19 20:49:34 +08:00
    orzfly
        1
    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
        2
    mhtt  
       2014-09-18 20:34:01 +08:00
    同遇到过这个问题,处理办法是
    把 `/home/git/gitlab/config/gitlab.yml` 里面的 https: true 同时修改端口 port: 443 (默认是80)
    larkifly
        3
    larkifly  
    OP
       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
        4
    mengzhuo  
       2014-09-19 09:46:26 +08:00
    @larkifly 请学好英语再学编程
    larkifly
        5
    larkifly  
    OP
       2014-09-19 10:24:16 +08:00
    @mengzhuo 现在是linux能push,windows下出现这个错误
    mengzhuo
        6
    mengzhuo  
       2014-09-19 10:30:00 +08:00
    windows 用git bash的话,你确定你的私钥能登入?
    larkifly
        7
    larkifly  
    OP
       2014-09-19 20:49:34 +08:00 via Android
    @mengzhuo 私钥在http情况下能登入并且push,https不行,有没有可能是https的ssl证书是自己生成的,所以push的时候git检查这个ssl返回的错误了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2440 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 10:47 · PVG 18:47 · LAX 03:47 · JFK 06:47
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.