huruyosi’s blog

プログラミングとかインフラとかのメモです。

GitHubからのcloneで「Problem with the SSL CA cert (path? access rights?)」

落ちは過去に行った設定が原因での自爆でした。環境は CentOS 7.1 です。

事象

$ git clone https://github.com/xxxx/a_repository.git

ってやる実行と

Cloning into 'a_repository'...
fatal: unable to access 'https://github.com/xxxx/a_repository.git': Problem with the SSL CA cert (path? access rights?)

となり失敗してしまう。

こまった

逃げない

検索してみるとgit config --global http.sslVerify false という目先のエラーだけを解決しようとするブログは多いけど、SSL的に証明書のチェックは適切にやりたいので見送り。

ROOTCAの証明書を追加する方法

tetsuyai.hatenablog.com

sudo yum --disableplugin=priorities info ca-certificatesを行うと、インストール済みになった。

ダウンロードしてopenssl x509 -in DigiCertHighAssuranceEVRootCA.crt -fingerprint -nooutopenssl x509 -in DigiCertHighAssuranceEVRootCA.crt -serial -nooutでチェックしたものを/etc/pki/tls/certs/ca-bundle.crtに追加してもだめ。

  ~/.gitconfigで 証明書を指定する

derekmolloy.ie

になった ~/.gitconfigに証明書を記載する方法でごまかす事にして 編集すると随分昔に自己署名証明書で試した時の記述が残っていた。

cat ~/.gitconfig
[http]
#       sslCAInfo = /home/huruyosi/ssl/test_root.cert
        sslVerify = true
[user]
~ 省略 ~

sslCAInfo をコメントアウトして解決。なんともお粗末な結果。