TLS (1.0) support and workaround for SNI breakage in Java 7

These patches improve TLS protocol support and work around a bug/feature in Java 7 regarding SNI support. Please refer to the small, individual commit messages for an extended description and rationale.