2 // ssl/impl/context.hpp
3 // ~~~~~~~~~~~~~~~~~~~~
5 // Copyright (c) 2005 Voipster / Indrek dot Juhani at voipster dot com
6 // Copyright (c) 2005-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
8 // Distributed under the Boost Software License, Version 1.0. (See accompanying
9 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
12 #ifndef BOOST_ASIO_SSL_IMPL_CONTEXT_HPP
13 #define BOOST_ASIO_SSL_IMPL_CONTEXT_HPP
15 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
17 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
19 #include <boost/asio/detail/config.hpp>
21 #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
22 # include <boost/asio/detail/throw_error.hpp>
23 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
25 #include <boost/asio/detail/push_options.hpp>
31 #if !defined(BOOST_ASIO_ENABLE_OLD_SSL)
33 template <typename VerifyCallback>
34 void context::set_verify_callback(VerifyCallback callback)
36 boost::system::error_code ec;
37 this->set_verify_callback(callback, ec);
38 boost::asio::detail::throw_error(ec, "set_verify_callback");
41 template <typename VerifyCallback>
42 boost::system::error_code context::set_verify_callback(
43 VerifyCallback callback, boost::system::error_code& ec)
45 return do_set_verify_callback(
46 new detail::verify_callback<VerifyCallback>(callback), ec);
49 template <typename PasswordCallback>
50 void context::set_password_callback(PasswordCallback callback)
52 boost::system::error_code ec;
53 this->set_password_callback(callback, ec);
54 boost::asio::detail::throw_error(ec, "set_password_callback");
57 template <typename PasswordCallback>
58 boost::system::error_code context::set_password_callback(
59 PasswordCallback callback, boost::system::error_code& ec)
61 return do_set_password_callback(
62 new detail::password_callback<PasswordCallback>(callback), ec);
65 #endif // !defined(BOOST_ASIO_ENABLE_OLD_SSL)
71 #include <boost/asio/detail/pop_options.hpp>
73 #endif // BOOST_ASIO_SSL_IMPL_CONTEXT_HPP