Configurable connect timeout

cc @tmm1