How to fix boost::beast system_error uninitialized (SSL routines)

Problem:

While running your boost::beast https client you see the following error message:

example.txt
terminate called after throwing an instance of 'boost::wrapexcept<boost::system::system_error>'
  what():  uninitialized (SSL routines) [asio.ssl:167772436]

Solution

You forgot to handshake before writing the HTTP request:

example.cpp
stream.handshake(ssl::stream_base::client);

 


Check out similar posts by category: Boost, C/C++