git没有完全使用自签名证书

use*_*437 2 ssl gitlab

我使用自签名证书来加密.
经过一些工作,https正在为git工作,但git @ xxxxx方式不起作用.这是输出:

Cloning into 'test'...
/usr/lib/ruby/1.9.1/net/http.rb:762:in `initialize': Connection refused - connect(2 (Errno::ECONNREFUSED)
    from /usr/lib/ruby/1.9.1/net/http.rb:762:in `open'
    from /usr/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
    from /usr/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
    from /usr/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
    from /usr/lib/ruby/1.9.1/net/http.rb:762:in `connect'
    from /usr/lib/ruby/1.9.1/net/http.rb:755:in `do_start'
    from /usr/lib/ruby/1.9.1/net/http.rb:744:in `start'
    from /home/git/gitlab-shell/lib/gitlab_net.rb:56:in `get'
    from /home/git/gitlab-shell/lib/gitlab_net.rb:17:in `allowed?'
    from /home/git/gitlab-shell/lib/gitlab_shell.rb:51:in `validate_access'
    from /home/git/gitlab-shell/lib/gitlab_shell.rb:21:in `exec'
    from /home/git/gitlab-shell/bin/gitlab-shell:16:in `<main>'
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

在启动自签名证书之前,ssh和http都工作正常,所以现在ssh + ssl无法正常工作.我正在使用nginx,gitlab 5.3,遵循gitlab网站上的安装说明.

我也做了一张支票.

~> sudo -u git -H /home/git/gitlab-shell/bin/check
Check GitLab API access: FAILED. code: 301

Check directories and files: 
    /home/git/repositories: OK
    /home/git/.ssh/authorized_keys: OK
Run Code Online (Sandbox Code Playgroud)

我认为301可能是我的nginx配置中的这一部分:

server {
     listen         80;
     server_name    gitlab.MYDOMAIN.com;
     rewrite        ^ https://$server_name$request_uri? permanent;
}
Run Code Online (Sandbox Code Playgroud)

不知道是否相关或感谢.

Tho*_*est 5

您遇到的问题是当您启用ssl时,您还将http重定向到https.

访问旧http://URL对大多数客户端都有效,但gitlab-shell(在gitlab服务器上用作登录过程的一部分)不会遵循3xx重定向,而是返回错误,从而禁用基于ssh的访问.

解决方法是编辑/home/git/gitlab-shell/config.yml和替换http://gitlab_url:https://.

如果您使用自签名的证书,您可能还需要设置self_signed_cert: truehttp_settings: