Print detailed errors in case of "Unexpected SSL error"
client certificates require SSL_CTX_set_session_id_context, also handle cases when chain is NULL.