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

Problem:

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

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:

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