]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // |
2 | // ssl/verify_mode.hpp | |
3 | // ~~~~~~~~~~~~~~~~~~~ | |
4 | // | |
f67539c2 | 5 | // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) |
7c673cae FG |
6 | // |
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) | |
9 | // | |
10 | ||
11 | #ifndef BOOST_ASIO_SSL_VERIFY_MODE_HPP | |
12 | #define BOOST_ASIO_SSL_VERIFY_MODE_HPP | |
13 | ||
14 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) | |
15 | # pragma once | |
16 | #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) | |
17 | ||
18 | #include <boost/asio/detail/config.hpp> | |
19 | #include <boost/asio/ssl/detail/openssl_types.hpp> | |
20 | ||
21 | #include <boost/asio/detail/push_options.hpp> | |
22 | ||
23 | namespace boost { | |
24 | namespace asio { | |
25 | namespace ssl { | |
26 | ||
27 | /// Bitmask type for peer verification. | |
28 | /** | |
29 | * Possible values are: | |
30 | * | |
31 | * @li @ref verify_none | |
32 | * @li @ref verify_peer | |
33 | * @li @ref verify_fail_if_no_peer_cert | |
34 | * @li @ref verify_client_once | |
35 | */ | |
36 | typedef int verify_mode; | |
37 | ||
38 | #if defined(GENERATING_DOCUMENTATION) | |
39 | /// No verification. | |
40 | const int verify_none = implementation_defined; | |
41 | ||
42 | /// Verify the peer. | |
43 | const int verify_peer = implementation_defined; | |
44 | ||
45 | /// Fail verification if the peer has no certificate. Ignored unless | |
46 | /// @ref verify_peer is set. | |
47 | const int verify_fail_if_no_peer_cert = implementation_defined; | |
48 | ||
49 | /// Do not request client certificate on renegotiation. Ignored unless | |
50 | /// @ref verify_peer is set. | |
51 | const int verify_client_once = implementation_defined; | |
52 | #else | |
53 | const int verify_none = SSL_VERIFY_NONE; | |
54 | const int verify_peer = SSL_VERIFY_PEER; | |
55 | const int verify_fail_if_no_peer_cert = SSL_VERIFY_FAIL_IF_NO_PEER_CERT; | |
56 | const int verify_client_once = SSL_VERIFY_CLIENT_ONCE; | |
57 | #endif | |
58 | ||
59 | } // namespace ssl | |
60 | } // namespace asio | |
61 | } // namespace boost | |
62 | ||
63 | #include <boost/asio/detail/pop_options.hpp> | |
64 | ||
65 | #endif // BOOST_ASIO_SSL_VERIFY_MODE_HPP |