Unable to clone repo from github Visual Studio 2013

Avi Caspe Source

I am trying to clone a project from github (https://github.com/bhilburn/powerlevel9k to be specific, but all github repos fail in the same way), using Visual Studio 2013's native git integration.

I tried going to File -> Open From Source Control. That opens up the "Team Explorer" window on the left. I then click on the drop down panel for "Clone" under the "Local Git Repositories" heading. After that I enter the URL for powerlevel9k. VS2013 then gives me a very unhelpful message: "An error occurred. Detailed message: An error occurred while sending the request."

Unhelpful Error Message

I am stuck. I do not know what to do here. Nothing I try seems to work. All github repos I have tried give me the same exact error message.

If anyone can help me sort this out I would be eternally greatful.

gitgithubvisual-studio-2013cloning

Answers

answered 6 months ago Gregg L #1

TL;DR
This isn't a solution, rather just what we tried (none of which worked).
This way, anyone else who might stumble on this question later might be able to offer other ideas/solutions.

As this other SO question/answer points out (which I didn't see until yesterday afternoon), it might be best to use another tool for Git and not rely on VS 2013's Git support.

Full explanation
From what I could find on the Net, the rather unhelpful error message is most likely indicative of certificate issues when trying to connect to / work with an https repository (as written about in this blog article):

Special considerations for HTTPS endpoints
If an HTTPS URI is used for a remote, the Windows certificate store is used to validate the server’s SSL certificate.

If the server to which you are pushing/pulling has a self-signed certificate, then as of this writing, we give an unfortunate and vague error message to the user. “An error occurred while sending the request” [emphasis added by me] is what is commonly seen. You should use the Windows certificate manager (certmgr.msc) to add the self-signed certificate (or the authority at the top of the certificate’s chain) to the Windows certificate store as a trusted certificate, and then try your network operation again.

From the SO question (linked at beginning of answer) points out (which coincidentally links to the same article as above), it's not clear at all what certificate(s) would need to be added.

After more searching, I found another article that seemed might be related (dealing with SSL and certificate issues) (although it was regarding VS 2015, not 2013, and the error message wasn't the same):

Google pointed me at the .gitconfig file that lives at the root of your user directory. When I looked at that it contained not much at all – just a reference to the recently cloned repository I had tested with above. So I added the setting necessary to tell Git to find it’s trusted certificates in the same place that the command line tools had reported:

[http] sslcainfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt

And remarkably that fixed Visual Studio…

This is what I had Avi try:

  1. Close Visual Studio if open
  2. From a command prompt, run the following: git config --list
  3. From the output, see if there is a 'http.sslcainfo' entry. It should/might have something like "C:\Program Files\Git...\certs\cabundle.crt"
  4. Copy that path
  5. In the gitconfig file in your user directory, try adding (replacing the path I show here with whatever the path from Step 4 is): [http] sslcainfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
  6. Save the file
  7. Restart Visual Studio and try to connect/push/pull to the Github repo

Avi also tried importing the 'ca-bundle.crt' certificate into Windows Certificate Manager.

And last, but not least, Avi tried adding that same [http] block to the 'config' file under the specific repo's '.git' folder.

answered 1 month ago TAHA SULTAN TEMURI #2

Please do verify following thing.

  1. The server you are trying to connect with is live.
  2. The server you are trying to connect with is not blocking your IP.
  3. The Url of connecting server is valid
  4. You and your server connecting with the router ,You are connecting with router ABC using ISP XYZ ,But your server is connecting with Router DBA using ISP HKA, and you think that I am on the same ISP and router being used by the server but this is not the case.In order to connect with server or push changes you and your server must connected with same ISP using same router (In This Scenario Only).

You can try if server is accessible using ping command in linux or in windows

ping 192.168.100.3 (replace ip with server ip)

comments powered by Disqus