Before this patch:
```
$ bitcoin-cli -testnet echo 'hello world'
error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (/root/.bitcoin/bitcoin.conf)
```
After this patch:
```
$ bitcoin-cli -testnet echo 'hello world'
error: Could not connect to the server 127.0.0.1:18332
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
```
// Try fall back to cookie-based authentication if no password is provided
// Try fall back to cookie-based authentication if no password is provided
if(!GetAuthCookie(&strRPCUserColonPass)){
if(!GetAuthCookie(&strRPCUserColonPass)){
throwstd::runtime_error(strprintf(
failedToGetAuthCookie=true;
_("Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (%s)"),
throwCConnectionFailed(strprintf("Could not connect to the server %s:%d%s\n\nMake sure the bitcoind server is running and that you are connecting to the correct RPC port.",host,port,responseErrorMessage));
}elseif(response.status==HTTP_UNAUTHORIZED){
if(failedToGetAuthCookie){
throwstd::runtime_error(strprintf(
_("Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (%s)"),