Supports boringssl (SSL_R_SHORT_READ)

master
Ryan Lee 2017-10-22 23:52:21 +09:00
parent 106dc45651
commit 3c73978688
1 changed files with 4 additions and 0 deletions

View File

@ -355,13 +355,17 @@ protected:
template <typename ErrorCodeType>
lib::error_code translate_ec(ErrorCodeType ec) {
if (ec.category() == lib::asio::error::get_ssl_category()) {
#ifdef SSL_R_SHORT_READ
if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) {
return make_error_code(transport::error::tls_short_read);
} else {
#endif
// We know it is a TLS related error, but otherwise don't know
// more. Pass through as TLS generic.
return make_error_code(transport::error::tls_error);
#ifdef SSL_R_SHORT_READ
}
#endif
} else {
// We don't know any more information about this error so pass
// through