This blog post is about an error that you may receive if you’re using git commands in PowerShell and authenticating against GitHub.
My GitHub account uses 2 Factor Authentication so I thought it might be that – however I could use GitHub Desktop fine.
I was cloning a new project for a client:
git clone https://github.com/Client/Documentation.git
and I got a prompt for my username/password but when I entered both I got an error. O knew my username and password OK and I knew 2FA was working too.
The error (taken from event logs) was:
System.Net.Http.HttpRequestException: An error occurred while sending the request. —> System.Net.WebException: The request was aborted: Could not create SSL/TLS secure channel.
So I looked at my Git for Windows version:
PS C:\Yip> git version
git version 2.14.2.windows.1
So I decided to upgrade – as I had been meaning to do this for a while.
So I downloaded the latest version for windows and 2.16.2
I then ran the same command – which prompted me for my GitHub username/password. I entered them and asked me for my 2 Factor password which I put in and hooray!! — it worked.
I successfully cloned the repo and can now do work for a client who has stuff stored in GitHub.