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