I didn't know that remote-curl.c requires 200 OK even if you want to report an error. With Ilari's patch at [1] you'll get a more readable message but it is still good enough now. [1]: http://permalink.gmane.org/gmane.comp.version-control.git/155464
As usual there's more documentation than code. Unlike usual, however, this isn't completely tested. Please read the documentation for details of what works, what doesn't, what has been tested, what hasn't, and so on.