Git: Управление сертификатами

Для определенного уже существующего репозитория:

git config http.sslVerify false

Для репозитория при клонировании:

git -c http.sslVerify=false clone <repository-name>

Глобальная настройка для всех репозиториев:

git config --global http.sslVerify false

Дано: git clone выдает ошибку «ssl certificate problem: self-signed in chain», ОС: корпоративная винда

Решение: выполнить команду переключения git на системные сертификаты

git config --global http.sslBackend schannel

Подробности: https://stackoverflow.com/questions/16668508/how-do-i-configure-git-to-trust-certificates-from-the-windows-certificate-store

Beginning with Git for Windows 2.14, you can now configure Git to use SChannel, the built-in Windows networking layer. This means that it will use the Windows certificate storage mechanism and you do not need to explicitly configure the curl CA storage mechanism.

Once you have configured this, Git will use the Windows certificate store and should not require (and, in fact, should ignore) the http.sslCAInfo configuration setting.

Use:

git config  --local ...

To specify per-repository settings. Local settings are stored in the .git directory.

An overview of the three locations where git can store settings:

  • –local: Repository specific, <repo_dir>/.git/config
  • –global: User-specific, ~/.gitconfig
  • –system: System default, /etc/gitconfig

More specific ones override more general settings, i.e. local overrides both global and system.

  • devops/git/git-certificates.txt
  • Последнее изменение: 2022/03/18 09:43
  • 127.0.0.1