zaphoyd / websocketpp

C++ websocket client/server library
http://www.zaphoyd.com/websocketpp
Other
6.97k stars 1.97k forks source link

‘SSL_R_SHORT_READ’ was not declared #725

Open ivan-zapreev opened 6 years ago

ivan-zapreev commented 6 years ago

OpeSSL1.1.0 backwards compatibility issue.

websocketpp0.7.0/transport/asio/security/tls.hpp: In member function ‘std::error_code websocketpp::transport::asio::tls_socket::connection::translate_ec(ErrorCodeType)’:
websocketpp0.7.0/transport/asio/security/tls.hpp:358:47: error: ‘SSL_R_SHORT_READ’ was not declared in this scope
             if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) {
                                               ^~~~~~~~~~~~~~~~
websocketpp0.7.0/transport/asio/security/tls.hpp:358:47: note: suggested alternative: ‘SSL_F_SSL_READ’
             if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) {
                                               ^~~~~~~~~~~~~~~~
                                               SSL_F_SSL_READ
ivan-zapreev commented 6 years ago

The error also appears with the latest (1-12-0) release of ASIO from https://github.com/chriskohlhoff/asio/releases

ChrisZhangJin commented 1 year ago

i encountered the same problem on centos 7 when building websocketpp 0.8.2 . but i just installed openssl 1.1.0l version which was not the default version on that OS. I removed this openssl and installed the default version (using yum install openssl,1.0.2k), and everything went well then.

Apparently, it seems that websocketpp 0.8.2 is not compatible with newer version of openssl( later than 1.0.2k). Using the proper version of openssl for building websocketpp is quite crucial.