Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Cryptography/SSL/SocketStream.cpp
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. 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 (const ConnectionOrientedStreamSocket::Ptr& sd, const ClientContext::Options& o) -> Ptr
26{
27#if qStroika_HasComponent_OpenSSL
28 return Providers::OpenSSL::SocketStream::New (sd, Providers::OpenSSL::ClientContext::Options{o});
29#else
30 Throw (RequiredComponentMissingException{"SSL providing service"sv});
31#endif
32}
33auto Cryptography::SSL::SocketStream::New (const ConnectionOrientedStreamSocket::Ptr& sd, const ServerContext::Options& o) -> Ptr
34{
35#if qStroika_HasComponent_OpenSSL
36 return Providers::OpenSSL::SocketStream::New (sd, Providers::OpenSSL::ServerContext::Options{o});
37#else
38 Throw (RequiredComponentMissingException{"SSL providing service"sv});
39#endif
40}
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)
identical to builtin C++ 'throw' except that it does helpful, type dependent DbgTrace() messages firs...
Definition Throw.inl:43