Skip to content

Commit

Permalink
added support for OpenSSL 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MilanFranc committed May 23, 2018
1 parent 4ebb31a commit 0ddb573
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions websocketpp/transport/asio/security/tls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,21 @@ class connection : public lib::enable_shared_from_this<connection> {
template <typename ErrorCodeType>
lib::error_code translate_ec(ErrorCodeType ec) {
if (ec.category() == lib::asio::error::get_ssl_category()) {

#if OPENSSL_VERSION_NUMBER <= 0x010090
if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) {
return make_error_code(transport::error::tls_short_read);
} else {
// 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);
}
#else
// 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);
#endif

} else {
// We don't know any more information about this error so pass
// through
Expand Down

0 comments on commit 0ddb573

Please sign in to comment.