O'Reilly logo

Boost.Asio C++ Network Programming by John Torjo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SSL

Boost.Asio provides classes for some basic SSL support. Behind the scenes, it uses OpenSSL. So, if you want to use SSL, first download OpenSSL from www.openssl.org and build it. You should note that, usually, building OpenSSL is no easy task, especially if you don't have a popular compiler, such as Visual Studio.

Assuming you have OpenSSL built successfully, Boost.Asio has some wrapper classes around it:

  • ssl::stream: It guides you to what to use instead of the ip::<protocol>::socket class
  • ssl::context: This is the context for initial handshake
  • ssl::rfc2818_verification: This class is the easy way to verify a certificate against a hostname according to the rules from RFC 2818

First, you create and initialize the SSL context, then open a socket using ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required