Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,13 @@ class connection : public lib::enable_shared_from_this<connection> {
*/
lib::error_code translate_ec(boost::system::error_code ec) {
if (ec.category() == boost::asio::error::get_ssl_category()) {
#if defined SSL_R_SHORT_READ
if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) {
return make_error_code(transport::error::tls_short_read);
#else
if (ERR_GET_REASON(ec.value()) == boost::asio::ssl::error::stream_truncated) {
return make_error_code(boost::asio::ssl::error::stream_truncated);
#endif
} else {
// We know it is a TLS related error, but otherwise don't know
// more. Pass through as TLS generic.
Expand Down