0

Our internal corporate NTLM proxy (Also Squid i think) randomly returns 407 errors for some reason, and it's pointless to even try to get someone to fix that.

I have on my Windows computer an installation of Cntlm proxy on port 3128 to be able to use non-NTLM-aware software. However, i still randomly get 407 errors from the corporate proxy.

To work around this, i setup a Squid Cache (Version 2.7.STABLE8) proxy on localhost forwarding to Cntlm, thinking i could have it retry on error.

I use the following configuration:

cache_dir ufs c:/ws/tmp/squidcache 500 16 256
http_port 3127
cache_peer 127.0.0.1 parent 3128 0 no-query default
acl all src 127.0.0.1
never_direct allow all
http_access allow all
retry_on_error on
maximum_single_addr_tries 10
maximum_object_size 100 MB

It mostly works, but the problem is that jar-files end up slightly corrupted. I haven't figured out exactly how they are corrupted, but they are generally a couple of bytes longer than they should be, and even bytes in the beginning of the files are corrupted. And it's different each time.

I found http://javatechniques.com/blog/squid-corrupts-jar-files/ which suggests it might be a problem with mime type configuration and Squid treating jar-files as ASCII, but does not tell you how to fix it in Squid.

I tried adding

\.jar$      application/octet-stream        anthony-compressed.gif  -   image   +download
# the default
.       application/octet-stream    anthony-unknown.gif -   image   +download

to Squids mime.conf, and clearing the cache, but that didn't help. I didn't really expect it to help since i think those are only used for proxying FTP.

  • Make sure you restart the web server after making the mime changes and test it without the Squid cache to ensure it is serving JAR files with the correct MIME type (i.e., using Firebug or similar utility to check headers). – uesp Mar 04 '11 at 14:11
  • @uesp: Thanks, but i don't have admin access to the web servers, that's the whole point. I'm downloading from multiple servers on the internet. Eclipse update sites, in fact. – Christoffer Hammarström Mar 04 '11 at 14:14

1 Answers1

0

Did you try using Squid 3.1? We've been using 3.x for some time now and didn't notice jarfile corruption yet.

CyberOptic
  • 307
  • 3
  • 13