I found what appears to be a bug: with a long enough username and password combination, the base64 encoder in bitcoind produces authorization headers that look like this: Code:POST / HTTP/1.1 User-Agent: json-rpc/1.0 Host: 127.0.0.1 Content-Type: application/json Content-Length: 40 Accept: application/json Authorization: Basic YWJiYWJiYWFiYmE6aGVsbG93b3JsZGhlbGxvd29ybGRoZWxsb3dvcmxkaGVsbG93 b3JsZGhlbGxvd29ybGRoZWxsb3dvcmxk It inserts a newline every 64 characters, which obviously breaks the Authorization header, so commands like “bitcoin getinfo” fail. The server still works fine with properly behaving clients.
This can be solved by removing the newlines (and maybe ‘\r’s) from result at the end of the Base64Encode function: Code:result.erase(std::remove(result.begin(), result.end(), ‘\n’), result.end()); result.erase(std::remove(result.begin(), result.end(), ‘\r’), result.end()); There’s probably a more elegant solution, but that works for me. Here’s a patch: http://www.alloscomp.com/bitcoin/patches/bitcoin-svn-109-rpcbug-2010-07-25.patch