Do this while both istream and ostream still exist. Fixes crash where
openssl_iostream_destroy() attempts to flush the shutdown, but ssl_input
is NULL and it crashes.
{
struct ssl_istream *sstream = (struct ssl_istream *)stream;
+ openssl_iostream_shutdown(sstream->ssl_io);
i_stream_free_buffer(&sstream->istream);
sstream->ssl_io->ssl_input = NULL;
ssl_iostream_unref(&sstream->ssl_io);
struct ssl_ostream *sstream = (struct ssl_ostream *)stream;
struct istream *ssl_input = sstream->ssl_io->ssl_input;
+ openssl_iostream_shutdown(sstream->ssl_io);
sstream->ssl_io->ssl_output = NULL;
i_stream_unref(&ssl_input);
ssl_iostream_unref(&sstream->ssl_io);