GitHubからCloneをする際にSSLエラーが発生する

vagrant-redmine を使ってRedmineのテスト環境を構築しようとしていたのですが、
GitHubからRedmineのソースをCloneする際にエラーが発生しましたので、
その際の原因と対処法についての覚え書きです。

環境

  • OS
    • Windows 10 Home 10.0.17134 ビルド 17134
  • Vagrant
    • Version 2.1.1
  • Vagrant Box histudy/stretch
    • Version 9.5.0
  • ウイルス対策ソフト
    • カスペルスキー インターネット セキュリティ 17.0.0.611 (m)

実行エラーメッセージ

TASK [redmine : checkout Redmine] **********************************************
fatal: [default]: FAILED! => {"changed": false, "cmd": "/usr/bin/git clone --origin origin https://github.com/redmine/redmine.git /opt/redmine", "msg": "Cloning into '/opt/redmine'...\nfatal: unable to access 'https://github.com/redmine/redmine.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none", "rc": 128, "stderr": "Cloning into '/opt/redmine'...\nfatal: unable to access 'https://github.com/redmine/redmine.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none\n", "stderr_lines": ["Cloning into '/opt/redmine'...", "fatal: unable to access 'https://github.com/redmine/redmine.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none"], "stdout": "", "stdout_lines": []}

原因

カスペルスキーの「ウェブ保護」が原因で、このエラーが発生していました。
現在のところ、「ウェブ保護」を「オフ」にすることで回避できます。
「除外リストの管理に追加」や「信頼するWebサイトの設定に追加」では、
本エラーの回避はできません。

参考