Skip to content

error: ‘SSL_R_SHORT_READ’ was not declared in this scope #187

@Stupid-Git

Description

@Stupid-Git

On Debian 9 64bit I installed Boost using
# apt-get install boost-all-dev
I ran cmake as follows
$ cmake -DBOOST_INCLUDEDIR=/usr/include/boost -DBOOST_LIBRARYDIR=/usr/lib/x86_64-linux-gnu -DBOOST_VER:STRING=1.62 ./
and then ran
$ make install
Scanning dependencies of target sioclient
[ 10%] Building CXX object CMakeFiles/sioclient.dir/src/sio_client.cpp.o
[ 20%] Building CXX object CMakeFiles/sioclient.dir/src/sio_socket.cpp.o
[ 30%] Building CXX object CMakeFiles/sioclient.dir/src/internal/sio_client_impl.cpp.o
[ 40%] Building CXX object CMakeFiles/sioclient.dir/src/internal/sio_packet.cpp.o
[ 50%] Linking CXX static library libsioclient.a
[ 50%] Built target sioclient
Scanning dependencies of target sioclient_tls
[ 60%] Building CXX object CMakeFiles/sioclient_tls.dir/src/sio_client.cpp.o
In file included from /disk_d/share/w/github/socketio/socket.io-client-cpp/lib/websocketpp/websocketpp/config/asio_client.hpp:33:0,
from /disk_d/share/w/github/socketio/socket.io-client-cpp/src/internal/sio_client_impl.h:26,
from /disk_d/share/w/github/socketio/socket.io-client-cpp/src/sio_client.cpp:8:
/disk_d/share/w/github/socketio/socket.io-client-cpp/lib/websocketpp/websocketpp/transport/asio/security/tls.hpp: In member function ‘std::error_code websocketpp::transport::asio::tls_socket::connection::translate_ec(boost::system::error_code)’:
/disk_d/share/w/github/socketio/socket.io-client-cpp/lib/websocketpp/websocketpp/transport/asio/security/tls.hpp:310:47: error: ‘SSL_R_SHORT_READ’ was not declared in this scope
if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) {
^~~~~~~~~~~~~~~~
CMakeFiles/sioclient_tls.dir/build.make:62: recipe for target 'CMakeFiles/sioclient_tls.dir/src/sio_client.cpp.o' failed
make[2]: *** [CMakeFiles/sioclient_tls.dir/src/sio_client.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/sioclient_tls.dir/all' failed
make[1]: *** [CMakeFiles/sioclient_tls.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

$
I made the following changes around line 310 of ./lib/websocketpp/websocketpp/transport/asio/security/tls.hpp
#if BOOST_VERSION >= 106200
if (ec.value() == boost::asio::ssl::error::stream_truncated) {
#else // older Boost supports only OpenSSL 1.0, so 1.0-only macros are appropriate
if (ERR_GET_REASON(ec.value()) == SSL_R_SHORT_READ) {
#endif

and cmake passed.

This is of course an issue in websocketpp (which many have been "fixed" already), but for those of you lowly hardware engineers like myself, I offer this as a quick and dirty fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions