We should have integration tests to cover connection failures/timeouts. One possible approach is to use iptables to drop/reject packets. For instance, to test that a socket connect timeout is triggered, something like `iptables -A OUTPUT -p tcp -j DROP --dport 389` can be used. We should investigate how to play with this on Travis.