Do not BIO_clear_flags() when the SSL error is not valid to fix #2056