Git・GitHub Desktopで文字化けエラーによりFetch/Push/Pullができないときの対策法


現象

以下のエラーメッセージにより、Git Hub DesktopでレポジトリのFetch/Push/Pullができなくなる。

fatal: unable to access 'https://github.com/AvocadoWasabi/****.git/': schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - �����̊֐��͏ؖ����̎�����m�F�ł��܂���ł����B

また、エラーメッセージは文字化けしている。

正確なエラーメッセージ

エラーコード0x80092012について調べると、文字化け前のエラーメッセージは以下の通りとなる

schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) -
The revocation function was unable to check revocation for the certificate.

再現環境

Windows 10 Home
GitHub Desktop 1.3.4
カスペルスキー インターネットセキュリティ 17.0.0.611(m)
Git 2.18.0 インストール時に 「Use the native Windows Secure Channel libraryを選択」

原因

インストールされているセキュリティソフト(カスペルスキー)で
暗号化されたネットワーク接続(SSL,TLS)をスキャンする機能を有効にしていると、
起こる。

これは、GitはWindows Secure Channel libraryを使っているにもかかわらず、
セキュリティソフトが独自の証明書を使って接続しようと介入するので、
トラブルが起こるためと考えられる。

OpenSSlをインストールして実行してみた場合

GitHubへの接続に、確かにカスペルスキーの証明書が使用されていることがわかる。

openssl s_client  -connect www.github.com:443
CONNECTED(00000178)
depth=1 O = AO Kaspersky Lab, CN = Kaspersky Anti-Virus Personal Root Certificate
verify error:num=19:self signed certificate in certificate chain
---
Certificate chain
 0 s:/businessCategory=Private Organization/jurisdictionC=US/jurisdictionST=Delaware/serialNumber=5157550/C=US/ST=California/L=San Francisco/O=GitHub, Inc./CN=github.com
   i:/O=AO Kaspersky Lab/CN=Kaspersky Anti-Virus Personal Root Certificate
 1 s:/O=AO Kaspersky Lab/CN=Kaspersky Anti-Virus Personal Root Certificate
   i:/O=AO Kaspersky Lab/CN=Kaspersky Anti-Virus Personal Root Certificate
---
(略)

回避策

暗号化されたネットワーク接続のスキャン機能、あるいはセキュリティソフトを一時的に無効化してから、
GitHub Desktopの操作を行う。

カスペルスキーの例

その他の回避法

以下のコマンドをコマンドラインで入力することでも回避することはできるが、
SSL証明検証を常にOFFにするということのため、
セキュリティレベルが落ちるかもしれない。
急にGitにCloneもPushもできなくなった話(Qiita)

git config --global http.sslVerify false

参考

The revocation function is unable to check revocation for the certificate