summaryrefslogtreecommitdiff
path: root/boost/asio/ssl/context_base.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/asio/ssl/context_base.hpp')
-rw-r--r--boost/asio/ssl/context_base.hpp67
1 files changed, 43 insertions, 24 deletions
diff --git a/boost/asio/ssl/context_base.hpp b/boost/asio/ssl/context_base.hpp
index 3c0b59d65f..692372d4ba 100644
--- a/boost/asio/ssl/context_base.hpp
+++ b/boost/asio/ssl/context_base.hpp
@@ -2,7 +2,7 @@
// ssl/context_base.hpp
// ~~~~~~~~~~~~~~~~~~~~
//
-// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -16,7 +16,6 @@
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include <boost/asio/detail/config.hpp>
-#include <boost/detail/workaround.hpp>
#include <boost/asio/ssl/detail/openssl_types.hpp>
#include <boost/asio/detail/push_options.hpp>
@@ -67,33 +66,59 @@ public:
sslv23_client,
/// SSL/TLS server.
- sslv23_server
+ sslv23_server,
+
+ /// Generic TLS version 1.1.
+ tlsv11,
+
+ /// TLS version 1.1 client.
+ tlsv11_client,
+
+ /// TLS version 1.1 server.
+ tlsv11_server,
+
+ /// Generic TLS version 1.2.
+ tlsv12,
+
+ /// TLS version 1.2 client.
+ tlsv12_client,
+
+ /// TLS version 1.2 server.
+ tlsv12_server
};
/// Bitmask type for SSL options.
- typedef int options;
+ typedef long options;
#if defined(GENERATING_DOCUMENTATION)
/// Implement various bug workarounds.
- static const int default_workarounds = implementation_defined;
+ static const long default_workarounds = implementation_defined;
/// Always create a new key when using tmp_dh parameters.
- static const int single_dh_use = implementation_defined;
+ static const long single_dh_use = implementation_defined;
/// Disable SSL v2.
- static const int no_sslv2 = implementation_defined;
+ static const long no_sslv2 = implementation_defined;
/// Disable SSL v3.
- static const int no_sslv3 = implementation_defined;
+ static const long no_sslv3 = implementation_defined;
/// Disable TLS v1.
- static const int no_tlsv1 = implementation_defined;
+ static const long no_tlsv1 = implementation_defined;
+
+ /// Disable compression. Compression is disabled by default.
+ static const long no_compression = implementation_defined;
#else
- BOOST_STATIC_CONSTANT(int, default_workarounds = SSL_OP_ALL);
- BOOST_STATIC_CONSTANT(int, single_dh_use = SSL_OP_SINGLE_DH_USE);
- BOOST_STATIC_CONSTANT(int, no_sslv2 = SSL_OP_NO_SSLv2);
- BOOST_STATIC_CONSTANT(int, no_sslv3 = SSL_OP_NO_SSLv3);
- BOOST_STATIC_CONSTANT(int, no_tlsv1 = SSL_OP_NO_TLSv1);
+ BOOST_ASIO_STATIC_CONSTANT(long, default_workarounds = SSL_OP_ALL);
+ BOOST_ASIO_STATIC_CONSTANT(long, single_dh_use = SSL_OP_SINGLE_DH_USE);
+ BOOST_ASIO_STATIC_CONSTANT(long, no_sslv2 = SSL_OP_NO_SSLv2);
+ BOOST_ASIO_STATIC_CONSTANT(long, no_sslv3 = SSL_OP_NO_SSLv3);
+ BOOST_ASIO_STATIC_CONSTANT(long, no_tlsv1 = SSL_OP_NO_TLSv1);
+# if defined(SSL_OP_NO_COMPRESSION)
+ BOOST_ASIO_STATIC_CONSTANT(long, no_compression = SSL_OP_NO_COMPRESSION);
+# else // defined(SSL_OP_NO_COMPRESSION)
+ BOOST_ASIO_STATIC_CONSTANT(long, no_compression = 0x20000L);
+# endif // defined(SSL_OP_NO_COMPRESSION)
#endif
/// File format types.
@@ -111,11 +136,11 @@ public:
// New programs should use the equivalents of the same names that are defined
// in the boost::asio::ssl namespace.
typedef int verify_mode;
- BOOST_STATIC_CONSTANT(int, verify_none = SSL_VERIFY_NONE);
- BOOST_STATIC_CONSTANT(int, verify_peer = SSL_VERIFY_PEER);
- BOOST_STATIC_CONSTANT(int,
+ BOOST_ASIO_STATIC_CONSTANT(int, verify_none = SSL_VERIFY_NONE);
+ BOOST_ASIO_STATIC_CONSTANT(int, verify_peer = SSL_VERIFY_PEER);
+ BOOST_ASIO_STATIC_CONSTANT(int,
verify_fail_if_no_peer_cert = SSL_VERIFY_FAIL_IF_NO_PEER_CERT);
- BOOST_STATIC_CONSTANT(int, verify_client_once = SSL_VERIFY_CLIENT_ONCE);
+ BOOST_ASIO_STATIC_CONSTANT(int, verify_client_once = SSL_VERIFY_CLIENT_ONCE);
#endif
/// Purpose of PEM password.
@@ -133,12 +158,6 @@ protected:
~context_base()
{
}
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
-private:
- // Workaround to enable the empty base optimisation with Borland C++.
- char dummy_;
-#endif
};
} // namespace ssl