[#1934] Correctly log handshake errors and not print them to STDERR