Open vinniefalco opened 7 years ago
void handle_read(const boost::system::error_code& error, size_t bytes_transferred)
{
if (!error) {
// Process the data
} else if (error == boost::asio::error::eof) {
// Handle graceful closure
try {
ssl_stream.shutdown();
} catch (const boost::system::system_error& e) {
if (e.code() != boost::asio::ssl::error::stream_truncated) {
// Handle unexpected error during shutdown
}
// Graceful closure with stream_truncated can be considered normal
}
} else {
// Handle other errors
}
}
I'm on OpenSSL 1.0.2k (Jan 26, 2017) and Boost.Asio 1.64.0
When the remote host closes an SSL stream I get this error
stream_truncated
is that new? How do I properly detect graceful closure?