Accessing Git Remote Repo behind a corporate firewall

I ran into the ff. errors below while cloning my repo from bitbucket (w/ screenshot)

error: Connection time-out while accessing https://<remote_repo_username>@bitbucket.org/<remote_repo_username>/<repo>.git/info/refs?service=git-upload-pack
fatal: HTTP request failed

connectiontimeout

I later found out that I have to fix the git proxy settings on my local machine first so I could get through back and forth (as seen below).

git config --global http.proxy http://<domain_name>:<domain_passowrd>@<proxy_server>:<port>

where:

  • domain_name: my active directory user name. this is also the name i use to log in to my workstation
  • domain_password: active directory password
  • proxy_server: the proxy server (consult your admin regarding this)
  • port: the port used by your proxy server, which is by default, 8080.

These settings worked for me and I can now access my remote repository. But please do note that you must first configure your LAN settings in order to follow the above procedures.

Could not fetch specs from https://rubygems.org/: Ruby Gems behind the corporate firewall

Image

This error might be a case of running bundle, or gem install behind a (corporate) firewall. To be able to get through, you have to specify the HTTP_PROXY environment for your session.

Image

Type the following on your current session:

set HTTP_PROXY=http://your_username:your_passoword@server:port

Also, I haven’t checked if the character case of the HTTP_PROXY matters. So to be sure, type the variable name using UPPERCASES.

To check if the variable was set, just type:

set HTTP_PROXY

If it was properly set in the previous step, then the variable-value pair will show up.

For more info, you may visit the ff. sites:

  • The source of the solution above:

http://stackoverflow.com/questions/4418/how-do-i-update-ruby-gems-from-behind-a-proxy-isa-ntlm

  • Parameter –http-proxy from inside the gem.bat (an alternative so you won’t need to set environment variable HTTP_PROXY over and over again, but I haven’t tested it):

http://stackoverflow.com/questions/1903005/installing-gems-from-behind-a-corporate-firewall

  • If you feel like giving up and chose to do a manual work-around (this works, and this is the long-cut):

http://help.rubygems.org/kb/rubygems/installing-gems-with-no-network