forked from boostorg/beast
ssl_stream is a public interface
This commit is contained in:
@@ -3,6 +3,7 @@ Version 219:
|
||||
* More split definitions in test::stream
|
||||
* Visual Studio 2017 minimum requirement for Windows
|
||||
* Better treatment of SSL short reads
|
||||
* ssl_stream is a public interface
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
@@ -38,14 +38,15 @@
|
||||
<member><link linkend="beast.ref.boost__beast__iequal">iequal</link></member>
|
||||
<member><link linkend="beast.ref.boost__beast__iless">iless</link></member>
|
||||
<member><link linkend="beast.ref.boost__beast__rate_policy_access">rate_policy_access</link> <emphasis role="green">🞲</emphasis></member>
|
||||
<member><link linkend="beast.ref.boost__beast__saved_handler">saved_handler</link> <emphasis role="green">🞲</emphasis></member>
|
||||
</simplelist>
|
||||
</entry>
|
||||
<entry valign="top">
|
||||
<bridgehead renderas="sect3">Classes <emphasis role="normal">(2 of 2)</emphasis></bridgehead>
|
||||
<simplelist type="vert" columns="1">
|
||||
<member><link linkend="beast.ref.boost__beast__saved_handler">saved_handler</link> <emphasis role="green">🞲</emphasis></member>
|
||||
<member><link linkend="beast.ref.boost__beast__span">span</link></member>
|
||||
<member><link linkend="beast.ref.boost__beast__simple_rate_policy">simple_rate_policy</link> <emphasis role="green">🞲</emphasis></member>
|
||||
<member><link linkend="beast.ref.boost__beast__ssl_stream">ssl_stream</link> <emphasis role="green">🞲</emphasis></member>
|
||||
<member><link linkend="beast.ref.boost__beast__static_string">static_string</link></member>
|
||||
<member><link linkend="beast.ref.boost__beast__stable_async_op_base">stable_async_op_base</link> <emphasis role="green">🞲</emphasis></member>
|
||||
<member><link linkend="beast.ref.boost__beast__string_param">string_param</link></member>
|
||||
@@ -362,7 +363,6 @@
|
||||
<entry valign="top">
|
||||
<bridgehead renderas="sect3">Classes</bridgehead>
|
||||
<simplelist type="vert" columns="1">
|
||||
<member><link linkend="beast.ref.boost__beast__ssl_stream">ssl_stream</link></member>
|
||||
<member><link linkend="beast.ref.boost__beast__http__icy_stream">http::icy_stream</link></member>
|
||||
<member><link linkend="beast.ref.boost__beast__test__fail_count">test::fail_count</link></member>
|
||||
<member><link linkend="beast.ref.boost__beast__test__handler">test::handler</link> <emphasis role="green">🞲</emphasis></member>
|
||||
|
@@ -104,13 +104,14 @@ WARN_LOGFILE =
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = \
|
||||
$(LIB_DIR)/include/boost/beast/ \
|
||||
$(LIB_DIR)/include/boost/beast/core \
|
||||
$(LIB_DIR)/include/boost/beast/http \
|
||||
$(LIB_DIR)/include/boost/beast/websocket \
|
||||
$(LIB_DIR)/include/boost/beast/zlib \
|
||||
$(LIB_DIR)/include/boost/beast/_experimental/core \
|
||||
$(LIB_DIR)/include/boost/beast/_experimental/http \
|
||||
$(LIB_DIR)/include/boost/beast/_experimental/test
|
||||
$(LIB_DIR)/include/boost/beast/_experimental/test \
|
||||
$(LIB_DIR)/include/boost/beast/core \
|
||||
$(LIB_DIR)/include/boost/beast/http \
|
||||
$(LIB_DIR)/include/boost/beast/ssl \
|
||||
$(LIB_DIR)/include/boost/beast/websocket \
|
||||
$(LIB_DIR)/include/boost/beast/zlib
|
||||
|
||||
INPUT_ENCODING = UTF-8
|
||||
FILE_PATTERNS =
|
||||
@@ -289,6 +290,7 @@ PREDEFINED = \
|
||||
BOOST_BEAST_DOXYGEN \
|
||||
BOOST_BEAST_USE_POSIX_FILE=1 \
|
||||
BOOST_BEAST_USE_WIN32_FILE=1 \
|
||||
BOOST_BEAST_SPLIT_COMPILATION=1 \
|
||||
BOOST_ASIO_INITFN_RESULT_TYPE(t,a)=__deduced__ \
|
||||
GENERATING_DOCUMENTATION \
|
||||
BOOST_BEAST_DECL
|
||||
|
@@ -6,6 +6,9 @@
|
||||
<xsl:when test="contains($file, 'boost/beast/http')">
|
||||
<xsl:text>

Convenience header [include_file boost/beast/http.hpp]
</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($file, 'boost/beast/ssl')">
|
||||
<xsl:text>

Convenience header [include_file boost/beast/ssl.hpp]
</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="contains($file, 'boost/beast/websocket')">
|
||||
<xsl:text>

Convenience header [include_file boost/beast/websocket.hpp]
</xsl:text>
|
||||
</xsl:when>
|
||||
|
17
include/boost/beast/ssl.hpp
Normal file
17
include/boost/beast/ssl.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail 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)
|
||||
//
|
||||
// Official repository: https://github.com/boostorg/beast
|
||||
//
|
||||
|
||||
#ifndef BOOST_BEAST_SSL_HPP
|
||||
#define BOOST_BEAST_SSL_HPP
|
||||
|
||||
#include <boost/beast/core/detail/config.hpp>
|
||||
|
||||
#include <boost/beast/ssl/ssl_stream.hpp>
|
||||
|
||||
#endif
|
@@ -16,6 +16,11 @@
|
||||
#include <boost/beast/websocket/ssl.hpp>
|
||||
|
||||
#include <boost/beast/core/flat_stream.hpp>
|
||||
|
||||
// VFALCO We include this because anyone who uses ssl will
|
||||
// very likely need to check for ssl::error::stream_truncated
|
||||
#include <boost/asio/ssl/error.hpp>
|
||||
|
||||
#include <boost/asio/ssl/stream.hpp>
|
||||
#include <cstddef>
|
||||
#include <memory>
|
||||
@@ -37,11 +42,11 @@ namespace beast {
|
||||
strand.
|
||||
|
||||
@par Example
|
||||
To use this template with a `net::ip::tcp::socket`, you would write:
|
||||
To use this template with a @ref tcp_stream, you would write:
|
||||
@code
|
||||
net::io_context ioc;
|
||||
net::ssl::context ctx{net::ssl::context::sslv23};
|
||||
boost::beast::ssl_stream<net:ip::tcp::socket> sock{ioc, ctx};
|
||||
beast::ssl_stream<beast::tcp_stream> sock{ioc, ctx};
|
||||
@endcode
|
||||
|
||||
In addition to providing an interface identical to `net::ssl::stream`,
|
@@ -11,9 +11,10 @@ add_definitions (-DBOOST_BEAST_ALLOW_DEPRECATED)
|
||||
add_definitions (-DBOOST_BEAST_TESTS)
|
||||
|
||||
|
||||
add_subdirectory (_experimental)
|
||||
add_subdirectory (core)
|
||||
add_subdirectory (experimental)
|
||||
add_subdirectory (http)
|
||||
add_subdirectory (ssl)
|
||||
add_subdirectory (websocket)
|
||||
add_subdirectory (zlib)
|
||||
|
||||
@@ -30,6 +31,7 @@ add_executable (tests-beast
|
||||
Jamfile
|
||||
core.cpp
|
||||
http.cpp
|
||||
ssl.cpp
|
||||
version.cpp
|
||||
websocket.cpp
|
||||
zlib.cpp
|
||||
|
@@ -10,32 +10,36 @@
|
||||
alias run-tests :
|
||||
[ compile core.cpp ]
|
||||
[ compile http.cpp ]
|
||||
[ compile ssl.cpp ]
|
||||
[ compile version.cpp ]
|
||||
[ compile websocket.cpp ]
|
||||
[ compile zlib.cpp ]
|
||||
_experimental//run-tests
|
||||
core//run-tests
|
||||
http//run-tests
|
||||
ssl//run-tests
|
||||
websocket//run-tests
|
||||
zlib//run-tests
|
||||
experimental//run-tests
|
||||
;
|
||||
|
||||
alias fat-tests :
|
||||
_experimental//fat-tests
|
||||
core//fat-tests
|
||||
http//fat-tests
|
||||
ssl//fat-tests
|
||||
websocket//fat-tests
|
||||
zlib//fat-tests
|
||||
experimental//fat-tests
|
||||
;
|
||||
|
||||
explicit fat-tests ;
|
||||
|
||||
alias run-fat-tests :
|
||||
_experimental//run-fat-tests
|
||||
core//run-fat-tests
|
||||
http//run-fat-tests
|
||||
ssl//run-fat-tests
|
||||
websocket//run-fat-tests
|
||||
zlib//run-fat-tests
|
||||
experimental//run-fat-tests
|
||||
;
|
||||
|
||||
explicit run-fat-tests ;
|
||||
|
@@ -9,17 +9,16 @@
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/extras/include/boost/beast extras)
|
||||
GroupSources (test/beast/experimental "/")
|
||||
GroupSources (test/beast/_experimental "/")
|
||||
|
||||
add_executable (tests-beast-experimental
|
||||
add_executable (tests-beast-_experimental
|
||||
${BOOST_BEAST_FILES}
|
||||
${EXTRAS_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
error.cpp
|
||||
icy_stream.cpp
|
||||
ssl_stream.cpp
|
||||
stream.cpp
|
||||
)
|
||||
|
||||
set_property(TARGET tests-beast-experimental PROPERTY FOLDER "tests")
|
||||
set_property(TARGET tests-beast-_experimental PROPERTY FOLDER "tests")
|
11
test/beast/ssl.cpp
Normal file
11
test/beast/ssl.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail 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)
|
||||
//
|
||||
// Official repository: https://github.com/boostorg/beast
|
||||
//
|
||||
|
||||
// Test that header file is self-contained.
|
||||
#include <boost/beast/ssl.hpp>
|
20
test/beast/ssl/CMakeLists.txt
Normal file
20
test/beast/ssl/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail 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)
|
||||
#
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
GroupSources (include/boost/beast beast)
|
||||
GroupSources (test/beast/ssl "/")
|
||||
|
||||
add_executable (tests-beast-ssl
|
||||
${BOOST_BEAST_FILES}
|
||||
${TEST_MAIN}
|
||||
Jamfile
|
||||
ssl_stream.cpp
|
||||
)
|
||||
|
||||
set_property(TARGET tests-beast-ssl PROPERTY FOLDER "tests")
|
29
test/beast/ssl/Jamfile
Normal file
29
test/beast/ssl/Jamfile
Normal file
@@ -0,0 +1,29 @@
|
||||
#
|
||||
# Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail 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)
|
||||
#
|
||||
# Official repository: https://github.com/boostorg/beast
|
||||
#
|
||||
|
||||
local SOURCES =
|
||||
ssl_stream.cpp
|
||||
;
|
||||
|
||||
local RUN_TESTS ;
|
||||
|
||||
for local f in $(SOURCES)
|
||||
{
|
||||
RUN_TESTS += [ run $(f) $(TEST_MAIN) ] ;
|
||||
}
|
||||
|
||||
alias run-tests : $(RUN_TESTS) ;
|
||||
|
||||
exe fat-tests : $(TEST_MAIN) $(SOURCES) ;
|
||||
|
||||
explicit fat-tests ;
|
||||
|
||||
run $(TEST_MAIN) $(SOURCES) : : : : run-fat-tests ;
|
||||
|
||||
explicit run-fat-tests ;
|
15
test/beast/ssl/ssl_stream.cpp
Normal file
15
test/beast/ssl/ssl_stream.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail 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)
|
||||
//
|
||||
// Official repository: https://github.com/boostorg/beast
|
||||
//
|
||||
|
||||
#if BOOST_BEAST_USE_OPENSSL
|
||||
|
||||
// Test that header file is self-contained.
|
||||
#include <boost/beast/_experimental/core/ssl_stream.hpp>
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user