2

our company provide internet access for us using proxy, but after configured http.proxy, i am keeping get HTTP code 417 After a little google, i guess it's because the libcurl that git use sent the "Expect: 100-continue" header, which the proxy(i guess a Squid) does not understand and reply with 417: Expection failed.

I can not change the proxy setting, so below are my questions:

  1. can i disable the Expect header of libcurl? i know i can use -H option of curl(the binary), but seems git/ libcurl does not support this option.
  2. or how can i get around this problem without do anything with the proxy ?

Thanks in advance,

3 Answers 3

1

It sounds like you're trying to use Git through the proxy? You could try this:

git config --global http.proxy="http://<user>:<password>@<proxy address>:<proxy port>"

For example,

git config --global http.proxy="http://jonathan:Password1@webproxy:8090"

Then, when performing a git clone or setting up a git remote, use http:// instead of git:// as the protocol.

Sign up to request clarification or add additional context in comments.

1 Comment

yes, i was using proxy, but my proxy does not support 100-continue header that Git's libcurl send to it. Sorry, it's my first question on StackOverflow, i do not know how to format the text.
0

I do not know about proxying with Squid, but if you only need to pull, could you mirror the git repository with curl or wget to a local folder, and then tell git to use that instead?

1 Comment

i was pull from github, could you tell me how can i mirror some project from github? For example github.com/mongodb/mongo-python-driver.git
0

I had similar problem, it seems that I could push small changes through (under 1 kb) but when trying it with larger push our proxy server kicked in (which uses Squid probably) and I got following trace as a result:

Counting objects: 50, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (20/20), done.
Writing objects: 100% (29/29), 3.47 KiB, done.
Total 29 (delta 11), reused 0 (delta 0)
error: RPC failed; result=22, HTTP code = 417
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

Problem was solved by unsetting all proxy settings from git as:

git config --global --unset-all http.proxy # to remove it from the global config
git config --unset-all http.proxy  # to remove it from the local repo config file

And adding our (stash git) LAN ip/domain to /etc/hosts as:

sudo /etc/hosts

Inside that file I added following:

192.168.xx.xxx  git.ourcompany.com

And boom, problem solved! (Dont forget to start up new terminal where you try that push.)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.