Fix a bug where SslHandler doesn't sometimes handle renegotiation correctly

- Fixes #1964