Tag Archives: Git Clone Error

[Solved] Git Clone Error: error setting certificate verify locations

Description

When using git clone to clone an item on GitHub or gitee, the following error is reported:

error setting certificate verify locations:

CAfile: E:/Git/mingw64/ssl/certs/ca-bundle. crt

CApath: none

analysis

According to the error prompt, there is an error in setting the certificate verification location, that is, the certificate file path is wrong.

When cloning a remote project, the security certificate will be verified first. If the local security certificate file cannot be found, an error will be reported.

This is why this error will not be reported when cloning projects on gitlab, because gitlab is generally built on the intranet and does not need to verify the security certificate.

Path errors often occur because the local Git is installed green, that is, it is directly extracted and used.

In this way, the path of the certificate file is still the path on the original machine. If the path of the new machine is inconsistent, the path error will be caused.

Solution:

For the above analysis, there are two solutions:

  • Modify certificate file path (recommended)
  • Turn off certificate verification

Turning off certificate verification may cause security problems. It is recommended to modify the certificate file path.

Modify certificate file path

There are two ways:

  • Execute the configuration command (recommended)
  • Modify the configuration file

The essence of these two methods is to modify the configuration file. However, some misoperations may occur when modifying the file, and the operation is more cumbersome. It is recommended to execute the configuration command.

Execute configuration command

git config --system http.sslcainfo "Git安装路径/mingw64/ssl/certs/ca-bundle.crt"

Modify profile

Git’s system configuration files are located at: git installation path \etc\gitconfig

Modify the path in the file as shown in the figure to git installation path /mingw64/ssl/certs/ca-bundle.crt save again.

Turn off certificate verification

git config --system http.sslverify false

This method may cause git security problems and is not recommended.

[Solved] Git Clone Error: The TLS connection was non-properly terminated.

Operating system: Ubuntu 18.04

Test time: November 18, 2021

Problem Description:

Recently, the author encountered the following problems when downloading the repository on GitHub by using the GIT clone command, resulting in cloning failure

$ git clone https://github.com/pjreddie/darknet
Clone to 'darknet'...
fatal: unable to access 'https://github.com/pjreddie/darknet/': gnutls_handshake() failed: The TLS connection was non-properly terminated.

Solution:

Modify the HTTPS of the warehouse connection to git to clone

$ git clone https://github.com/pjreddie/darknet

Git Clone Error: ‘fatal: HTTP request failed‘

There are several possible reasons for this situation

1) Problems with git version

2) The system time is wrong

1) For the first case, use this command to see the GIT version.

git –version

Most of the time, just uninstall the original GIT and re install a newer version. ( https://www.kernel.org/pub/software/scm/git/ perhaps https://github.com/git/git/releases )

2) For the second case, just modify the system time directly.

Use commands to modify, such as:

date -s “25 MAY 2019 17:30:00”

Manual modification is also possible.