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出来るようになった。