9#include <userver/crypto/certificate.hpp>
10#include <userver/crypto/private_key.hpp>
11#include <userver/engine/deadline.hpp>
12#include <userver/engine/io/common.hpp>
13#include <userver/engine/io/socket.hpp>
14#include <userver/utils/fast_pimpl.hpp>
16USERVER_NAMESPACE_BEGIN
26class [[nodiscard]] TlsWrapper
final :
public RwBase {
30 const std::string& server_name,
36 const crypto::
PrivateKey& key, Deadline deadline,
37 const std::vector<crypto::Certificate>& cert_authorities = {});
39 ~TlsWrapper()
override;
41 TlsWrapper(
const TlsWrapper&) =
delete;
42 TlsWrapper(TlsWrapper&&)
noexcept;
72 [[nodiscard]] Socket
StopTls(Deadline deadline);
79 return RecvSome(buf, len, deadline);
86 return RecvAll(buf, len, deadline);
93 return SendAll(buf, len, deadline);
99 explicit TlsWrapper(Socket&&);
102 constexpr static size_t kSize = 296;
103 constexpr static size_t kAlignment = 8;
104 utils::FastPimpl<Impl, kSize, kAlignment> impl_;