在GitLab中添加证书颁发机构?

时间:2015-06-11 05:55:14

标签: ubuntu ssl https gitlab gitlab-ci

所以我正在尝试在我的服务器上使用HTTPS设置GitLab。听起来很简单吧?

嗯...

我有点使用自签名证书。并不一定只是一个自签名证书。我的系统上安装了根证书(运行Ubuntu 15.04,在/ etc / ssl / certs文件夹和/ etc / ssl / certs中的ca-certificates.crt文件中。我有一个中间证书和一个服务器证书我在我的服务器上使用HTTPS。但是,我似乎无法让OAUTH从GitLab CI工作。在我的服务器上从我的GitLab帐户中按下授权后,我收到500错误,上面写着“我们是对不起,出了点问题。“在日志中,我收到了这个错误:

法拉第:: SSLError(SSL_connect返回= 1 errno = 0状态= SSLv3读取服务器证书B:证书验证失败): app / controllers / user_sessions_controller.rb:18:在`callback'

我似乎无法弄清楚造成这个问题的原因。我正在为网络服务器运行一个证书链,我在Qualys SSLLabs测试中获得了一个A,我在搜索解决方案时看到的SSL Doctor Ruby应用程序发现我的证书链没有问题。在这一点上,我完全不知道可能导致此错误的原因。有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

在Gitlab 8.0 OmniBus CE

我首先必须将.pfx文件转换为.key [PEM]和.crt - > Details

使用PEM格式创建.key文件

openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]
openssl rsa -in [keyfile-encrypted.key] -outform PEM -out [keyfile-encrypted-pem.key]

创建.crt文件

openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]

更改gitlab.rb文件

sudo nano /etc/gitlab/gitlab.rb

根据Omnibus configuration,更改或取消注释以下行:

external_url "https://gitlab.example.com"

nginx['redirect_http_to_https'] = true
nginx['ssl_certificate'] = "/etc/gitlab/ssl/gitlab.belley.net.crt"
nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/gitlab.belley.net.key"

早期版本8.0

ci_external_url "https://ci.example.com"