26#ifndef ROUTER_SRC_OPENSSL_INCLUDE_TLS_DETAILS_TLS_BASE_H_
27#define ROUTER_SRC_OPENSSL_INCLUDE_TLS_DETAILS_TLS_BASE_H_
41template <
typename LowerLayer>
44 template <
typename Resource,
typename Result,
45 Result (*free_resource)(Resource *)>
51 using SslPtr = std::unique_ptr<SSL, Free<SSL, void, SSL_free>>;
52 using BioPtr = std::unique_ptr<BIO, Free<BIO, int, BIO_free>>;
62 BIO_new_bio_pair(&internal_bio, 0, &external_bio, 0);
63 SSL_set_bio(
ssl_.get(), internal_bio, internal_bio);
70 template <
typename... Args>
72 :
TlsBase(LowerLayer{
std::forward<Args>(args)...}, tls_context) {
73 SSL_set_accept_state(
ssl_.get());
76 template <
typename... Args>
78 :
TlsBase(LowerLayer{
std::forward<Args>(args)...}, tls_context) {
79 SSL_set_connect_state(
ssl_.get());
89 template <
typename SslIO,
typename BufferSequence,
typename Token,
90 typename TlsLayer,
typename Action>
Client TLS Context.
Definition: tls_client_context.h:43
wraps SSL_CTX.
Definition: tls_context.h:85
SSL_CTX * get() const
get non-owning pointer to SSL_CTX.
Definition: tls_context.h:159
TLS Context for the server side.
Definition: tls_server_context.h:51
Definition: flexible_buffer.h:91
Definition: ssl_io_completion.h:129
Definition: tls_base.h:46
void operator()(Resource *res)
Definition: tls_base.h:48
Definition: tls_base.h:42
uint8_t input_buffer_[k_tls_buffer_size]
Definition: tls_base.h:100
typename LowerLayer::native_handle_type socket_type
Definition: tls_base.h:53
TlsBase(TlsServerContext *tls_context, Args &&... args)
Definition: tls_base.h:71
LowerLayer lower_layer_
Definition: tls_base.h:95
TlsBase(TlsBase &&other)
Definition: tls_base.h:82
SslPtr ssl_
Definition: tls_base.h:97
LowerLayer LowerLayerType
Definition: tls_base.h:68
constexpr static uint32_t k_tls_buffer_size
Definition: tls_base.h:93
TlsBase(TlsClientContext *tls_context, Args &&... args)
Definition: tls_base.h:77
FlexibleOutputBuffer output_
Definition: tls_base.h:101
TlsContext * tls_context_
Definition: tls_base.h:96
typename LowerLayer::protocol_type protocol_type
Definition: tls_base.h:54
FlexibleInputBuffer input_
Definition: tls_base.h:102
std::unique_ptr< SSL, Free< SSL, void, SSL_free > > SslPtr
Definition: tls_base.h:51
TlsBase(LowerLayer &&layer, TlsContext *tls_context)
Definition: tls_base.h:56
uint8_t output_buffer_[k_tls_buffer_size]
Definition: tls_base.h:99
BioPtr network_bio_
Definition: tls_base.h:98
std::unique_ptr< BIO, Free< BIO, int, BIO_free > > BioPtr
Definition: tls_base.h:52
int native_handle_type
Definition: socket_constants.h:51
mutable_buffer buffer(void *p, size_t n) noexcept
Definition: buffer.h:418
Definition: gcs_xcom_synode.h:64
Result
Definition: result.h:34
Definition: tls_keylog_dumper.h:32
message Action
Definition: replication_group_member_actions.proto:30