diff options
author | lloyd <[email protected]> | 2012-03-23 00:00:43 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-03-23 00:00:43 +0000 |
commit | 16d6b8ccfcf6cfac5d654df6790f6d87226e8e17 (patch) | |
tree | e6259272e922f301ca634ba2451ddf6e060dc845 /doc | |
parent | 508060bd6c1a26cffd94d43eefcd83adab1cc895 (diff) |
Use the SQLite session manager if available
Diffstat (limited to 'doc')
-rw-r--r-- | doc/examples/tls_client.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/examples/tls_client.cpp b/doc/examples/tls_client.cpp index 1cca002af..d0a354e66 100644 --- a/doc/examples/tls_client.cpp +++ b/doc/examples/tls_client.cpp @@ -16,6 +16,10 @@ #include <errno.h> #include <fcntl.h> +#if defined(BOTAN_HAS_TLS_SQLITE_SESSION_MANAGER) + #include <botan/tls_sqlite_sess_mgr.h> +#endif + #include "credentials.h" using namespace Botan; @@ -62,6 +66,7 @@ bool handshake_complete(const TLS::Session& session) std::cout << "Protocol version " << session.version().to_string() << "\n"; std::cout << "Ciphersuite " << std::hex << session.ciphersuite().to_string() << "\n"; std::cout << "Session ID " << hex_encode(session.session_id()) << "\n"; + std::cout << "Session ticket " << hex_encode(session.session_ticket()) << "\n"; return true; } @@ -203,7 +208,13 @@ int main(int argc, char* argv[]) LibraryInitializer botan_init; AutoSeeded_RNG rng; TLS::Policy policy; + +#if defined(BOTAN_HAS_TLS_SQLITE_SESSION_MANAGER) + TLS::Session_Manager_SQLite session_manager("my secret passphrase", rng, + "sessions.db"); +#else TLS::Session_Manager_In_Memory session_manager; +#endif Credentials_Manager_Simple creds(rng); |