LoginSignup
12
8

More than 5 years have passed since last update.

.gitconfigのhttp設定のsslCAInfoはちゃんとサイト指定する

Last updated at Posted at 2015-06-30

Goのクロスコンパイル環境を作っている時に、Gitで特定のリポジトリがclone出来なかった。

$ git clone https://go.googlesource.com/tools.git

fatal: unable to access 'https://go.googlesource.com/tools.git/': SSL: certificate verification failed (result: 5)

良くないけど、SSLの検証をオフって実行してもダメ。

$ GIT_SSL_NO_VERIFY=1 git clone https://go.googlesource.com/tools.git

fatal: unable to access 'https://go.googlesource.com/tools.git/': SSL: CA certificate set, but certificate verification is disabled

.gitconfigを確認すると、社内GitLab用にpemが指定されていた。

.gitconfig
[http]
    sslCAInfo=/path/to/gitlab.pem

公式サイトを見ると、サイトごとの指定が出来るらしい。指定しないと全てのサイトに効いてしまうことが想像されたので、明示的に指定した。

.gitconfig
[http "https://gitlab.intra.foo.bar"]
    sslCAInfo=/path/to/gitlab.pem

その結果、問題なくclone出来るようになった。

参考

12
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
8