c++ - What does boost::asio::ssl::stream<boost::asio::ip::tcp::socket>::shutdown() do? -


the extensive documentation helpfully says:

this function used shut down ssl on stream. function call block until ssl has been shut down or error occurs.

which leaves me these questions:

  1. does close actual connection too?
  2. if not, how do that?
  3. can reuse stream calling boost::asio::connect(thesocket.lowest_layer(), ... again?

under covers, asio calls ssl_shutdown() in underlying openssl library:

the documentation here:

https://www.openssl.org/docs/manmaster/ssl/ssl_shutdown.html

... , contains following ominous text:

the behaviour of ssl_shutdown() additionally depends on underlying bio.

however, understanding of things ssl::stream object not socket (by design) more protocol layer sits on top of stream-like object. asio::ssl layer has no knowledge of next_layer() other must support free functions read,write, async_read , async_write. no knowledge whether layer supports concept of shutdown() (or close()).

therefore expect underlying socket, given lowest_layer() still open when shutdown() returns. furthermore, expect shutdown() not have been called on lowest_layer(). you'll want after ssl::shutdown returns, or in handler passed ssl::async_shutdown


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -