9#ifndef BOTAN_TLS_BLOCKING_CHANNELS_H_
10#define BOTAN_TLS_BLOCKING_CHANNELS_H_
12#include <botan/tls_client.h>
29 typedef std::function<size_t (uint8_t[],
size_t)>
read_fn;
30 typedef std::function<void (
const uint8_t[],
size_t)>
write_fn;
32 BOTAN_DEPRECATED(
"Use the regular TLS::Client interface")
41 const
std::vector<
std::
string>& next_protos = {});
52 size_t pending()
const {
return m_plaintext.size(); }
58 size_t read(uint8_t buf[],
size_t buf_len);
60 void write(
const uint8_t buf[],
size_t buf_len) { m_channel.send(buf, buf_len); }
65 void close() { m_channel.close(); }
67 bool is_closed()
const {
return m_channel.is_closed(); }
70 {
return m_channel.peer_cert_chain(); }
87 bool handshake_cb(
const Session&);
89 void data_cb(
const uint8_t data[],
size_t data_len);
91 void alert_cb(
const Alert& alert);
94 std::unique_ptr<Compat_Callbacks> m_callbacks;
std::function< size_t(uint8_t[], size_t)> read_fn
std::function< void(const uint8_t[], size_t)> write_fn
void write(const uint8_t buf[], size_t buf_len)
TLS::Channel & underlying_channel()
virtual bool handshake_complete(const Session &)
virtual ~Blocking_Client()=default
std::vector< X509_Certificate > peer_cert_chain() const
const TLS::Channel & underlying_channel() const
virtual void alert_notification(const Alert &)
#define BOTAN_PUBLIC_API(maj, min)
std::vector< T, secure_allocator< T > > secure_vector