File indexing completed on 2025-01-18 09:29:02
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_ASIO_SSL_CONTEXT_BASE_HPP
0012 #define BOOST_ASIO_SSL_CONTEXT_BASE_HPP
0013
0014 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
0015 # pragma once
0016 #endif
0017
0018 #include <boost/asio/detail/config.hpp>
0019 #include <boost/asio/ssl/detail/openssl_types.hpp>
0020
0021 #include <boost/asio/detail/push_options.hpp>
0022
0023 namespace boost {
0024 namespace asio {
0025 namespace ssl {
0026
0027
0028
0029 class context_base
0030 {
0031 public:
0032
0033 enum method
0034 {
0035
0036 sslv2,
0037
0038
0039 sslv2_client,
0040
0041
0042 sslv2_server,
0043
0044
0045 sslv3,
0046
0047
0048 sslv3_client,
0049
0050
0051 sslv3_server,
0052
0053
0054 tlsv1,
0055
0056
0057 tlsv1_client,
0058
0059
0060 tlsv1_server,
0061
0062
0063 sslv23,
0064
0065
0066 sslv23_client,
0067
0068
0069 sslv23_server,
0070
0071
0072 tlsv11,
0073
0074
0075 tlsv11_client,
0076
0077
0078 tlsv11_server,
0079
0080
0081 tlsv12,
0082
0083
0084 tlsv12_client,
0085
0086
0087 tlsv12_server,
0088
0089
0090 tlsv13,
0091
0092
0093 tlsv13_client,
0094
0095
0096 tlsv13_server,
0097
0098
0099 tls,
0100
0101
0102 tls_client,
0103
0104
0105 tls_server
0106 };
0107
0108
0109 typedef uint64_t options;
0110
0111 #if defined(GENERATING_DOCUMENTATION)
0112
0113 static const uint64_t default_workarounds = implementation_defined;
0114
0115
0116 static const uint64_t single_dh_use = implementation_defined;
0117
0118
0119 static const uint64_t no_sslv2 = implementation_defined;
0120
0121
0122 static const uint64_t no_sslv3 = implementation_defined;
0123
0124
0125 static const uint64_t no_tlsv1 = implementation_defined;
0126
0127
0128 static const uint64_t no_tlsv1_1 = implementation_defined;
0129
0130
0131 static const uint64_t no_tlsv1_2 = implementation_defined;
0132
0133
0134 static const uint64_t no_tlsv1_3 = implementation_defined;
0135
0136
0137 static const uint64_t no_compression = implementation_defined;
0138 #else
0139 BOOST_ASIO_STATIC_CONSTANT(uint64_t, default_workarounds = SSL_OP_ALL);
0140 BOOST_ASIO_STATIC_CONSTANT(uint64_t, single_dh_use = SSL_OP_SINGLE_DH_USE);
0141 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_sslv2 = SSL_OP_NO_SSLv2);
0142 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_sslv3 = SSL_OP_NO_SSLv3);
0143 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1 = SSL_OP_NO_TLSv1);
0144 # if defined(SSL_OP_NO_TLSv1_1)
0145 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_1 = SSL_OP_NO_TLSv1_1);
0146 # else
0147 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_1 = 0x10000000L);
0148 # endif
0149 # if defined(SSL_OP_NO_TLSv1_2)
0150 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_2 = SSL_OP_NO_TLSv1_2);
0151 # else
0152 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_2 = 0x08000000L);
0153 # endif
0154 # if defined(SSL_OP_NO_TLSv1_3)
0155 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_3 = SSL_OP_NO_TLSv1_3);
0156 # else
0157 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_tlsv1_3 = 0x20000000L);
0158 # endif
0159 # if defined(SSL_OP_NO_COMPRESSION)
0160 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_compression = SSL_OP_NO_COMPRESSION);
0161 # else
0162 BOOST_ASIO_STATIC_CONSTANT(uint64_t, no_compression = 0x20000L);
0163 # endif
0164 #endif
0165
0166
0167 enum file_format
0168 {
0169
0170 asn1,
0171
0172
0173 pem
0174 };
0175
0176 #if !defined(GENERATING_DOCUMENTATION)
0177
0178
0179
0180 typedef int verify_mode;
0181 BOOST_ASIO_STATIC_CONSTANT(int, verify_none = SSL_VERIFY_NONE);
0182 BOOST_ASIO_STATIC_CONSTANT(int, verify_peer = SSL_VERIFY_PEER);
0183 BOOST_ASIO_STATIC_CONSTANT(int,
0184 verify_fail_if_no_peer_cert = SSL_VERIFY_FAIL_IF_NO_PEER_CERT);
0185 BOOST_ASIO_STATIC_CONSTANT(int, verify_client_once = SSL_VERIFY_CLIENT_ONCE);
0186 #endif
0187
0188
0189 enum password_purpose
0190 {
0191
0192 for_reading,
0193
0194
0195 for_writing
0196 };
0197
0198 protected:
0199
0200 ~context_base()
0201 {
0202 }
0203 };
0204
0205 }
0206 }
0207 }
0208
0209 #include <boost/asio/detail/pop_options.hpp>
0210
0211 #endif