5 // Copyright (c) 2003-2017 Christopher M. Kohlhoff (chris at kohlhoff dot com)
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
11 #ifndef BOOST_ASIO_SSL_IMPL_ERROR_IPP
12 #define BOOST_ASIO_SSL_IMPL_ERROR_IPP
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 #include <boost/asio/detail/config.hpp>
19 #include <boost/asio/ssl/error.hpp>
20 #include <boost/asio/ssl/detail/openssl_init.hpp>
22 #include <boost/asio/detail/push_options.hpp>
29 class ssl_category : public boost::system::error_category
32 const char* name() const BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
37 std::string message(int value) const
39 const char* s = ::ERR_reason_error_string(value);
40 return s ? s : "asio.ssl error";
46 const boost::system::error_category& get_ssl_category()
48 static detail::ssl_category instance;
56 #if (OPENSSL_VERSION_NUMBER < 0x10100000L) && !defined(OPENSSL_IS_BORINGSSL)
58 const boost::system::error_category& get_stream_category()
60 return boost::asio::error::get_ssl_category();
67 class stream_category : public boost::system::error_category
70 const char* name() const BOOST_ASIO_ERROR_CATEGORY_NOEXCEPT
72 return "asio.ssl.stream";
75 std::string message(int value) const
79 case stream_truncated: return "stream truncated";
80 default: return "asio.ssl.stream error";
87 const boost::system::error_category& get_stream_category()
89 static detail::stream_category instance;
100 #include <boost/asio/detail/pop_options.hpp>
102 #endif // BOOST_ASIO_SSL_IMPL_ERROR_IPP