25#ifndef JOIN_CRYPTO_TLS_STREAM_HPP
26#define JOIN_CRYPTO_TLS_STREAM_HPP
41 template <
class Protocol>
46 using Socket =
typename Protocol::Socket;
47 using Transport =
typename Protocol::Transport::Socket;
48 using Mode =
typename Socket::Mode;
135 if (this->
_sockbuf.
socket ().waitHandshake (this->_sockbuf.deadline ()))
141 this->setstate (std::ios_base::failbit);
154 if (this->
_sockbuf.
socket ().waitShutdown (this->_sockbuf.deadline ()))
160 this->setstate (std::ios_base::failbit);
socket stream class.
Definition socket_stream.hpp:350
Socket & socket()
get the nested socket.
Definition socket_stream.hpp:520
SocketStreambuf _sockbuf
associated stream buffer.
Definition socket_stream.hpp:527
BasicSocketStream & operator=(const BasicSocketStream &other)=delete
copy assignment operator.
Socket & socket()
get the nested socket.
Definition socket_stream.hpp:229
TLS stream class.
Definition tls_stream.hpp:43
BasicTlsStream(Socket &&socket)
construct the TLS stream by moving an already wrapped TLS socket in.
Definition tls_stream.hpp:72
BasicTlsStream(Transport &&socket, TlsContext ctx=TlsContext{})
construct the TLS stream by wrapping an already connected transport socket.
Definition tls_stream.hpp:82
void shutdown()
perform the TLS shutdown (send a close_notify alert).
Definition tls_stream.hpp:148
BasicTlsStream(TlsContext ctx, Mode mode=Mode::NonBlocking)
construct the TLS stream instance using the given context.
Definition tls_stream.hpp:63
BasicTlsStream()
default constructor.
Definition tls_stream.hpp:53
bool encrypted()
check if the stream is encrypted.
Definition tls_stream.hpp:168
BasicTlsStream(BasicTlsStream &&other)
move constructor.
Definition tls_stream.hpp:104
typename Protocol::Endpoint Endpoint
Definition tls_stream.hpp:45
BasicTlsStream(const BasicTlsStream &other)=delete
copy constructor.
typename Protocol::Transport::Socket Transport
Definition tls_stream.hpp:47
BasicTlsStream & operator=(const BasicTlsStream &other)=delete
copy assignment operator.
void handshake()
perform the TLS handshake.
Definition tls_stream.hpp:129
typename Socket::Mode Mode
Definition tls_stream.hpp:48
typename Protocol::Socket Socket
Definition tls_stream.hpp:46
virtual ~BasicTlsStream()=default
destroy the TLS stream instance.
TLS/DTLS context.
Definition tls_context.hpp:42
Definition acceptor.hpp:32