From ebd662f38fbffe60dc0f3ac6771b7a0990191cde Mon Sep 17 00:00:00 2001 From: Christopher Kohlhoff Date: Sun, 1 Feb 2009 13:42:33 +0000 Subject: [PATCH] Fix errors in SSL overview and add a note about handshaking. Fixes #2617 and #2619. [SVN r50950] --- doc/overview/ssl.qbk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/overview/ssl.qbk b/doc/overview/ssl.qbk index 391e1ea3..549005ad 100644 --- a/doc/overview/ssl.qbk +++ b/doc/overview/ssl.qbk @@ -16,7 +16,7 @@ context object. This object is used to set SSL options such as verification mode, certificate files, and so on. As an illustration, client-side initialisation may look something like: - ssl::context ctx(io_service, ssl::context::sslv23); + ssl::context ctx(my_io_service, ssl::context::sslv23); ctx.set_verify_mode(ssl::context::verify_peer); ctx.load_verify_file("ca.pem"); @@ -29,7 +29,7 @@ connection or accepting an incoming one, the underlying socket must first be obtained using the `ssl::stream` template's [link boost_asio.reference.ssl__stream.lowest_layer `lowest_layer()`] member function: - ip::tcp::socket& sock = ssl_sock.lowest_layer(); + ip::tcp::socket::lowest_layer_type& sock = ssl_sock.lowest_layer(); sock.connect(my_endpoint); In some use cases the underlying stream object will need to have a longer @@ -39,6 +39,12 @@ reference to the stream type: ip::tcp::socket sock(my_io_service); ssl::stream ssl_sock(sock, ctx); +SSL handshaking must be performed prior to transmitting or receiving data over +an encrypted connection. This is accomplished using the `ssl::stream` +template's [link boost_asio.reference.ssl__stream.handshake handshake()] or +[link boost_asio.reference.ssl__stream.async_handshake async_handshake()] member +functions. + Once connected, SSL stream objects are used as synchronous or asynchronous read and write streams. This means the objects can be used with any of the [link boost_asio.reference.read read()], [link boost_asio.reference.async_read async_read()],