verify_mode.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // ssl/verify_mode.hpp
  3. // ~~~~~~~~~~~~~~~~~~~
  4. //
  5. // Copyright (c) 2003-2019 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. #ifndef BOOST_ASIO_SSL_VERIFY_MODE_HPP
  11. #define BOOST_ASIO_SSL_VERIFY_MODE_HPP
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. # pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. #include <boost/asio/detail/config.hpp>
  16. #include <boost/asio/ssl/detail/openssl_types.hpp>
  17. #include <boost/asio/detail/push_options.hpp>
  18. namespace boost {
  19. namespace asio {
  20. namespace ssl {
  21. /// Bitmask type for peer verification.
  22. /**
  23. * Possible values are:
  24. *
  25. * @li @ref verify_none
  26. * @li @ref verify_peer
  27. * @li @ref verify_fail_if_no_peer_cert
  28. * @li @ref verify_client_once
  29. */
  30. typedef int verify_mode;
  31. #if defined(GENERATING_DOCUMENTATION)
  32. /// No verification.
  33. const int verify_none = implementation_defined;
  34. /// Verify the peer.
  35. const int verify_peer = implementation_defined;
  36. /// Fail verification if the peer has no certificate. Ignored unless
  37. /// @ref verify_peer is set.
  38. const int verify_fail_if_no_peer_cert = implementation_defined;
  39. /// Do not request client certificate on renegotiation. Ignored unless
  40. /// @ref verify_peer is set.
  41. const int verify_client_once = implementation_defined;
  42. #else
  43. const int verify_none = SSL_VERIFY_NONE;
  44. const int verify_peer = SSL_VERIFY_PEER;
  45. const int verify_fail_if_no_peer_cert = SSL_VERIFY_FAIL_IF_NO_PEER_CERT;
  46. const int verify_client_once = SSL_VERIFY_CLIENT_ONCE;
  47. #endif
  48. } // namespace ssl
  49. } // namespace asio
  50. } // namespace boost
  51. #include <boost/asio/detail/pop_options.hpp>
  52. #endif // BOOST_ASIO_SSL_VERIFY_MODE_HPP