Get Rid of Git’s TLS Certificate Verification Warning

Lindsay Leeds
2 min readApr 14, 2022

Say goodbye to an annoying warning

Introduction

Every time I did a git push I received the following warning:

Here is a look at it in plain text format:

C:\Repos\MyProject>git push
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information.
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information.
Everything up-to-date

The Cure

What was strange to me, was that my repository on TFS is not using https. As you can see the URL is protocol httpon port 8080.

http://mytfs:8080/tfs/SEC/MyProject/git/MyProject

To fix it, I tried using the git config command:

git config http.sslVerify false

It turns out that this command is the problem, not the solution. I was finally able to get the warning to go away by removing all instances of http.sslVerify from all configs in git.

C:\Repos\MyProject>git config http.sslVerify falseC:\Repos\MyProject>git push
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information.
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information.
Everything up-to-date
C:\Repos\MyProject>git config --unset http.sslVerifyC:\Repos\MyProject>git push
Everything up-to-date

Figuring out exactly which git config file has the http.sslVerify setting can be tricky. I recommend using the command git config —list —show-origin to determine the location http.sslVerify is set.

Setting http.sslVerify to true also seems to solve the problem. Just make sure there are no stray false settings overriding it.

C:\Repos\MyProject>git config http.sslVerify trueC:\Repos\MyProject>git push
Everything up-to-date
C:\Repos\MyProject>git config http.sslVerify falseC:\Repos\MyProject>git push
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information.
warning: ----------------- SECURITY WARNING ----------------
warning: | TLS certificate verification has been disabled! |
warning: ---------------------------------------------------
warning: HTTPS connections may not be secure. See https://aka.ms/gcmcore-tlsverify for more information.
Everything up-to-date
C:\Repos\MyProject>

--

--

Lindsay Leeds

I am an IT guy by trade, with interests in investing and personal finance.