3

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

出色地...

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

Faraday::SSLError (SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed): app/controllers/user_sessions_controller.rb:18:in `callback'

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

4

1 回答 1

2

在 Gitlab 8.0 OmniBus CE 上

我首先必须将我的 .pfx 文件转换为 .key [PEM] 和 .crt ->详细信息

创建 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 配置,更改或取消注释以下行:

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" 
于 2015-10-08T13:37:12.230 回答