adapt error handling and RTT0 to tls-2.0