Stroika Library 3.0d25
 
Loading...
Searching...
No Matches
Cryptography/SSL/SocketStream.cpp
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2026. All rights reserved
3 */
4#include "Stroika/Foundation/StroikaPreComp.h"
5
6#if qStroika_HasComponent_OpenSSL
8#else
9#include "Stroika/Foundation/Execution/RequiredComponentMissingException.h"
10#endif
11#include "SocketStream.h"
12
13using namespace Stroika::Foundation;
14using namespace Stroika::Foundation::Cryptography;
15using namespace Stroika::Foundation::Execution;
16using namespace Stroika::Foundation::IO;
18using namespace Stroika::Foundation::Streams;
19
20/*
21 ********************************************************************************
22 ************************* Cryptography::SSL::SocketStream **********************
23 ********************************************************************************
24 */
25auto Cryptography::SSL::SocketStream::New ([[maybe_unused]] const ConnectionOrientedStreamSocket::Ptr& sd,
26 [[maybe_unused]] const ClientContext::Options& o) -> Ptr
27{
28#if qStroika_HasComponent_OpenSSL
29 return Providers::OpenSSL::SocketStream::New (sd, Providers::OpenSSL::ClientContext::Options{o});
30#else
31 Throw (RequiredComponentMissingException{"SSL providing service"sv});
32#endif
33}
34auto Cryptography::SSL::SocketStream::New ([[maybe_unused]] const ConnectionOrientedStreamSocket::Ptr& sd,
35 [[maybe_unused]] const ServerContext::Options& o) -> Ptr
36{
37#if qStroika_HasComponent_OpenSSL
38 return Providers::OpenSSL::SocketStream::New (sd, Providers::OpenSSL::ServerContext::Options{o});
39#else
40 Throw (RequiredComponentMissingException{"SSL providing service"sv});
41#endif
42}
A Streams::Ptr<ELEMENT_TYPE> is a smart-pointer to a stream of elements of type T.
Definition Stream.h:170
void Throw(T &&e2Throw)
like the builtin C++ 'throw', but stamps in the current Activity context and does helpful,...
Definition Throw.inl:54