24 static SslCtx CreateServerTlsContext(
25 const crypto::CertificatesChain& cert_chain,
27 const std::vector<crypto::
Certificate>& extra_cert_authorities = {}
30 static SslCtx CreateClientTlsContext(std::string_view server_name);
32 static SslCtx CreateClientTlsContext(
33 std::string_view server_name,
36 const std::vector<crypto::
Certificate>& extra_cert_authorities = {}
43 SslCtx(
const SslCtx&) =
delete;
46 void* GetRawSslCtx()
const noexcept;
49 [[
nodiscard]] std::span<
const unsigned char> GetAlpn()
const noexcept;
52 void AddCertAuthorities(
const std::vector<
Certificate>& cert_authorities);
53 void EnableVerifyClientCertificate();
54 void SetServerName(std::string_view server_name);
55 void SetCertificate(
const crypto::
Certificate& cert);
56 void SetCertificates(
const crypto::CertificatesChain& cert_chain);
57 void SetPrivateKey(
const crypto::
PrivateKey& key);
60 std::unique_ptr<Impl> impl_{};
62 explicit SslCtx(std::unique_ptr<Impl>&& impl);
63 std::span<
const unsigned char> alpn_;