Add configurable timeouts.

The tests for connect timeout require a firewall block rule, so will be marked as pending unless you set the relevant ENV variable.