mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
Add SSLContext
This commit is contained in:
@@ -77,6 +77,7 @@
|
|||||||
<ClInclude Include="..\..\modules\beast_asio\basics\beast_BufferType.h" />
|
<ClInclude Include="..\..\modules\beast_asio\basics\beast_BufferType.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\basics\beast_FixedInputBuffer.h" />
|
<ClInclude Include="..\..\modules\beast_asio\basics\beast_FixedInputBuffer.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\basics\beast_PeerRole.h" />
|
<ClInclude Include="..\..\modules\beast_asio\basics\beast_PeerRole.h" />
|
||||||
|
<ClInclude Include="..\..\modules\beast_asio\basics\SSLContext.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\beast_asio.h" />
|
<ClInclude Include="..\..\modules\beast_asio\beast_asio.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\handshake\beast_HandshakeDetectLogic.h" />
|
<ClInclude Include="..\..\modules\beast_asio\handshake\beast_HandshakeDetectLogic.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\handshake\beast_HandshakeDetectLogicPROXY.h" />
|
<ClInclude Include="..\..\modules\beast_asio\handshake\beast_HandshakeDetectLogicPROXY.h" />
|
||||||
@@ -88,7 +89,6 @@
|
|||||||
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_Socket.h" />
|
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_Socket.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_SocketBase.h" />
|
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_SocketBase.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_SocketWrapper.h" />
|
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_SocketWrapper.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_SslContext.h" />
|
|
||||||
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketWrapperStrand.h" />
|
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketWrapperStrand.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\system\beast_BoostIncludes.h" />
|
<ClInclude Include="..\..\modules\beast_asio\system\beast_BoostIncludes.h" />
|
||||||
<ClInclude Include="..\..\modules\beast_asio\system\beast_OpenSSLIncludes.h" />
|
<ClInclude Include="..\..\modules\beast_asio\system\beast_OpenSSLIncludes.h" />
|
||||||
@@ -333,6 +333,10 @@
|
|||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\modules\beast_asio\basics\SSLContext.cpp">
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\modules\beast_asio\beast_asio.cpp" />
|
<ClCompile Include="..\..\modules\beast_asio\beast_asio.cpp" />
|
||||||
<ClCompile Include="..\..\modules\beast_asio\handshake\beast_HandshakeDetectLogicPROXY.cpp">
|
<ClCompile Include="..\..\modules\beast_asio\handshake\beast_HandshakeDetectLogicPROXY.cpp">
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
@@ -352,12 +356,6 @@
|
|||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\modules\beast_asio\sockets\beast_SslContext.cpp">
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\modules\beast_asio\system\beast_BoostUnitTests.cpp">
|
<ClCompile Include="..\..\modules\beast_asio\system\beast_BoostUnitTests.cpp">
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
|
|||||||
@@ -686,9 +686,6 @@
|
|||||||
<ClInclude Include="..\..\modules\beast_core\diagnostic\beast_SemanticVersion.h">
|
<ClInclude Include="..\..\modules\beast_core\diagnostic\beast_SemanticVersion.h">
|
||||||
<Filter>beast_core\diagnostic</Filter>
|
<Filter>beast_core\diagnostic</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\modules\beast_asio\beast_asio.h">
|
|
||||||
<Filter>beast_asio</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_SocketBase.h">
|
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_SocketBase.h">
|
||||||
<Filter>beast_asio\sockets</Filter>
|
<Filter>beast_asio\sockets</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -701,9 +698,6 @@
|
|||||||
<ClInclude Include="..\..\modules\beast_asio\system\beast_BoostIncludes.h">
|
<ClInclude Include="..\..\modules\beast_asio\system\beast_BoostIncludes.h">
|
||||||
<Filter>beast_asio\system</Filter>
|
<Filter>beast_asio\system</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\modules\beast_asio\sockets\beast_SslContext.h">
|
|
||||||
<Filter>beast_asio\sockets</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\modules\beast_asio\tests\beast_TestPeer.h">
|
<ClInclude Include="..\..\modules\beast_asio\tests\beast_TestPeer.h">
|
||||||
<Filter>beast_asio\tests</Filter>
|
<Filter>beast_asio\tests</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -911,6 +905,12 @@
|
|||||||
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketWrapperStrand.h">
|
<ClInclude Include="..\..\modules\beast_asio\sockets\SocketWrapperStrand.h">
|
||||||
<Filter>beast_asio\sockets</Filter>
|
<Filter>beast_asio\sockets</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\modules\beast_asio\basics\SSLContext.h">
|
||||||
|
<Filter>beast_asio\basics</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\modules\beast_asio\beast_asio.h">
|
||||||
|
<Filter>beast_asio</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\modules\beast_core\beast_core.cpp">
|
<ClCompile Include="..\..\modules\beast_core\beast_core.cpp">
|
||||||
@@ -1282,9 +1282,6 @@
|
|||||||
<ClCompile Include="..\..\modules\beast_asio\beast_asio.cpp">
|
<ClCompile Include="..\..\modules\beast_asio\beast_asio.cpp">
|
||||||
<Filter>beast_asio</Filter>
|
<Filter>beast_asio</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\modules\beast_asio\sockets\beast_SslContext.cpp">
|
|
||||||
<Filter>beast_asio\sockets</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\modules\beast_asio\tests\beast_TestPeerBasics.cpp">
|
<ClCompile Include="..\..\modules\beast_asio\tests\beast_TestPeerBasics.cpp">
|
||||||
<Filter>beast_asio\tests</Filter>
|
<Filter>beast_asio\tests</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
@@ -1387,6 +1384,9 @@
|
|||||||
<ClCompile Include="..\..\modules\beast_core\memory\beast_PagedFreeStore.cpp">
|
<ClCompile Include="..\..\modules\beast_core\memory\beast_PagedFreeStore.cpp">
|
||||||
<Filter>beast_core\memory</Filter>
|
<Filter>beast_core\memory</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\modules\beast_asio\basics\SSLContext.cpp">
|
||||||
|
<Filter>beast_asio\basics</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Text Include="..\..\TODO.txt" />
|
<Text Include="..\..\TODO.txt" />
|
||||||
|
|||||||
@@ -16,3 +16,13 @@
|
|||||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
|
SSLContext::SSLContext (ContextType& context)
|
||||||
|
: m_context (context)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
SSLContext::~SSLContext ()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
@@ -17,25 +17,45 @@
|
|||||||
*/
|
*/
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
#ifndef BEAST_SSLCONTEXT_H_INCLUDED
|
#ifndef BEAST_ASIO_BASICS_SSLCONTEXT_H_INCLUDED
|
||||||
#define BEAST_SSLCONTEXT_H_INCLUDED
|
#define BEAST_ASIO_BASICS_SSLCONTEXT_H_INCLUDED
|
||||||
|
|
||||||
/** An SSL context that wraps a boost::asio::ssl::context. */
|
/** Simple base class for passing a context around.
|
||||||
class SslContextBase
|
This lets derived classes hide their implementation from the headers.
|
||||||
|
*/
|
||||||
|
class SSLContext : public Uncopyable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef boost::asio::ssl::context BoostContextType;
|
virtual ~SSLContext ();
|
||||||
virtual ~SslContextBase () { }
|
|
||||||
|
|
||||||
/** Conversion to boost::asio::ssl::context
|
// Saves typing
|
||||||
This lets you pass this object where the real thing is expected.
|
typedef boost::asio::ssl::context ContextType;
|
||||||
*/
|
|
||||||
operator BoostContextType& ()
|
inline ContextType& get () noexcept
|
||||||
{
|
{
|
||||||
return getBoostContext ();
|
return m_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual BoostContextType& getBoostContext () noexcept = 0;
|
inline ContextType const& get () const noexcept
|
||||||
|
{
|
||||||
|
return m_context;
|
||||||
|
}
|
||||||
|
|
||||||
|
// implicit conversion
|
||||||
|
inline operator ContextType& () noexcept
|
||||||
|
{
|
||||||
|
return get ();
|
||||||
|
}
|
||||||
|
|
||||||
|
inline operator ContextType const& () const noexcept
|
||||||
|
{
|
||||||
|
return get ();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
explicit SSLContext (ContextType& context);
|
||||||
|
|
||||||
|
ContextType& m_context;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -29,10 +29,10 @@ namespace beast
|
|||||||
#include "async/beast_SharedHandler.cpp"
|
#include "async/beast_SharedHandler.cpp"
|
||||||
|
|
||||||
#include "basics/beast_PeerRole.cpp"
|
#include "basics/beast_PeerRole.cpp"
|
||||||
|
#include "basics/SSLContext.cpp"
|
||||||
|
|
||||||
#include "sockets/beast_SocketBase.cpp"
|
#include "sockets/beast_SocketBase.cpp"
|
||||||
#include "sockets/beast_Socket.cpp"
|
#include "sockets/beast_Socket.cpp"
|
||||||
#include "sockets/beast_SslContext.cpp"
|
|
||||||
|
|
||||||
#include "handshake/beast_HandshakeDetectLogicPROXY.cpp"
|
#include "handshake/beast_HandshakeDetectLogicPROXY.cpp"
|
||||||
|
|
||||||
|
|||||||
@@ -73,12 +73,12 @@ namespace beast
|
|||||||
#include "basics/beast_BufferType.h"
|
#include "basics/beast_BufferType.h"
|
||||||
#include "basics/beast_FixedInputBuffer.h"
|
#include "basics/beast_FixedInputBuffer.h"
|
||||||
#include "basics/beast_PeerRole.h"
|
#include "basics/beast_PeerRole.h"
|
||||||
|
#include "basics/SSLContext.h"
|
||||||
|
|
||||||
#include "sockets/beast_SocketBase.h"
|
#include "sockets/beast_SocketBase.h"
|
||||||
#include "sockets/beast_Socket.h"
|
#include "sockets/beast_Socket.h"
|
||||||
#include "sockets/beast_SocketWrapper.h"
|
#include "sockets/beast_SocketWrapper.h"
|
||||||
#include "sockets/SocketWrapperStrand.h"
|
#include "sockets/SocketWrapperStrand.h"
|
||||||
#include "sockets/beast_SslContext.h"
|
|
||||||
|
|
||||||
#include "handshake/beast_InputParser.h"
|
#include "handshake/beast_InputParser.h"
|
||||||
#include "handshake/beast_HandshakeDetectLogic.h"
|
#include "handshake/beast_HandshakeDetectLogic.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user