Fix OpenSSL errors during (re-)negotiation

fixes #6724