Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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 4 '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 4 '11 at 14:14
add comment

1 Answer 1

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

share|improve this answer
    
Thanks, but i forgot to say that i'm on Windows, there is no Squid 3 for Windows. –  Christoffer Hammarström Mar 4 '11 at 12:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.