源码安装的gitlab,从http升级为https。解决升级后无法拉取代码的问题

gitlab版本

10.0.6

步骤

  1. 创建证书目录,将证书文件放到其中,并记住路径
  2. 编辑对应的nginx配置文件,在server块中,添加ssl配置项
  ssl on;
  ssl_certificate crt/test.cn.crt;
  ssl_certificate_key crt/test.cn.key;
  ssl_session_timeout 5m;
  ssl_session_cache shared:SSL:10m;
  ssl_protocols TLSv1.2 ; # don't use SSLv3 ref: POODLE
  ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!3DES:!MD5:!PSK';

  1. 到gitlab安装路径,编辑 gitlab配置文件. 将端口改为 443 , https改为true
vim config/gitlab.yml
gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    host: git.test.cn
    port: 443 # Set to 443 if using HTTPS, see installation.md#using-https for additional HTTPS configuration details
    https: true # Set to true if using HTTPS, see installation.md#using-https for additional HTTPS configuration details
  1. 重启 gitlab 重启nginx。

升级为https后,git pull git clone 无法使用

原因为未更改 gitlab-shell中配置文件
到gitlab-shell的安装目录中, 编辑配置文件, 将 gitlab_url改为https协议

vim config.yml
gitlab_url: https://git.test.cn

你可能感兴趣的:(杂记,git,git,pull,https,http)