Remove duplicated code, and apply timeout parameter to HttpClients' connectionRequestTimeout

I have seen a case where fetches are taking much longer to respond than the configured timeout-ms value. This change extends the timeout-ms to include the connectionRequestTimeout as well. Took the opportunity to strip out some repeated logic as well.