This content has been updated. You will be momentarily redirected to the current version.


Moved! I now blog at http://www.saicharan.in

Wednesday, December 13, 2006

Subclipse Proxy Configuration

Whew! That was a real big deal.

I wanted to checkout the newly open-sourced Google Web Toolkit using Eclipse via the Subversion plugin. I work behind a proxy and have a choice of three proxies offering varying capabilities and restrictions - some require authentication while others don't. When I tried checkout, I was in for a real surprise - I was getting an error message saying Error 407: Proxy authentication required. Since I did not set any proxy in the first place, I was wondering how a proxy was picked up and why I was not being prompted for authentication!

When I searched the Eclipse preferences dialog for SVN, I did not find any place where I can set up a proxy. Also, I wondered if Subclipse had somehow chosen to use my Windows default proxy configuration. So, I went to Control Panel > Internet Connection > Connections > LAN Settings. Nope, the default proxy that I had configured for my windows was different from the one that Subclipse was using - the default proxy did not require authentication while Subclipse was trying a proxy that required authentication. Exasperating!

Just wanted to be sure which proxy was being used. As usual, the Ethereal network protocol analyzer came to my rescue. I figured out that by default, Subclipse had chosen a proxy that needed authentication (I am yet to find out how it found the proxy address in the first place!) and had not prompted me for authentication. Then, a search through Eclipse help led me to this link: http://svnbook.red-bean.com/en/1.1/ch07.html#svn-ch-7-sect-1.2.

In short, I had to edit the registry to set my proxy - call that user friendly??? Well, since most of the time people who check out code are geeks, may be I should excuse this!!! Here is where I had to go:
HKCU\Software\Tigris.org\Subersion\Servers\Global\http-proxy-host and http-proxy-port values. Once I set up the proxy there, all worked well.

Whew!!! Breathe easy now :)


Mark Phippard said...

Subclipse does not do any network communication, we simply make Subversion API calls and it does the rest. Subversion does not currently have an API that lets you push configuration into the API. So you have to configure Subversion the same way a command line user does.

The best way to do it is actually to edit two files named "config" and "servers" which live in %APPDATA%\Subversion. There is a bug in the SVN 1.4 API we use for Subclipse where it does not read the registry for configuration information.

Why did Subversion choose this proxy? Good question. I have never heard of it picking up default settings. Do you use TortoiseSVN or any other SVN clients? If so, it is possible that you used one of those and configured this information in that tool.

It might be a bug in Subversion if it does not respond to an authentication challenge from a proxy server. You should test that using the command line and report it on users@subversion.tigris.org.

Mark Phippard said...

I just noticed how old your blog posts (I got it via Google alerts). When you wrote this, you were probably using SVN 1.3 which did not have the bug in reading the configuration from the registry.

Anonymous said...

Keep posting stuff like this i really like it