Sourcetree Suddenly Prompting for Github Credentials

By in , , ,
No comments

As a developer you’re probably familiar with the phrase “It was working before and I didn’t change anything!”

That hit me today as I attempted to pull an update from a Github repo using Sourcetree. I was prompted for Github credentials, which were repeatedly rejected. After verifying that the credentials were valid (and that I wasn’t hacked, whew) I did some hunting and found some helpful errors in the Git terminal and event viewer:

fatal: HttpRequestException encountered.
An error occurred while sending the request.

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.

That last one was particularly helpful (wish that Sourcetree would have surfaced this so I could have known better what to search for), and after a bit more hunting found this helpful thread:

Sourcetree to Bitbucket Server behind SSL not working

In the Sourcetree options under Network are two checkboxes to enable TLS 1.1 and/or TLS 1.2. Enabling both did not fix the problem, but checking ONLY the option for TLS 1.2 resolved the issue. I entered my credentials once more and am back to coding.

Edit: If you are unable to make this change or this fix doesn’t work for you, check out this link: https://support.microsoft.com/en-us/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-a-default-secure-protocols-in

Thanks to @GitKraken for the tip!

Edit 2: More info linked from the Git-Credential-Manager-for-Windows repo: Unable to connect to GitHub due to TLS 1.2 only change (HttpRequestException encountered. An error occurred while sending the request)

Hope this is helpful!

The following two tabs change content below.

selaromdotnet

Senior Developer at iD Tech
Josh loves all things Microsoft and Windows, and develops solutions for Web, Desktop and Mobile using the .NET Framework, Azure, UWP and everything else in the Microsoft Stack. His other passion is music, and in his spare time Josh spins and produces electronic music under the name DJ SelArom. His other passion is music, and in his spare time Josh spins and produces electronic music under the name DJ SelArom.