2#if defined(HAVE_CONFIG_H)
7#ifndef ASYNC_TLS_SOCKET_BASE_HXX
8#define ASYNC_TLS_SOCKET_BASE_HXX
11#include <asio/ssl.hpp>
35 asio::error_code
bind(
const asio::ip::address& address,
unsigned short port)
override;
36 void connect(
const std::string& address,
unsigned short port)
override;
60 asio::ssl::stream<asio::ip::tcp::socket>
mSocket;
64 asio::steady_timer mHandshakeTimer;
65 bool mServerHandshakeDone;
66 std::string mHostname;
67 bool mValidateServerCertificateHostname;
#define resip_assert(x)
This file needs to work for both C and C++ code.
asio::ip::address getSenderEndpointAddress() override
asio::ip::tcp::resolver mResolver
asio::ssl::stream< asio::ip::tcp::socket > mSocket
void transportSend(const StunTuple &destination, std::vector< asio::const_buffer > &buffers) override
void handleServerHandshake(const asio::error_code &e) override
void handleReadHeader(const asio::error_code &e) override
void transportFramedReceive() override
void transportReceive() override
virtual void onServerHandshakeFailure(const asio::error_code &e)
static bool setupClientSsl(SSL *ssl, const std::string &hostname, bool validateHostname)
Sets up a client SSL to connect to hostname (a host name or IP address): SNI for a host name,...
virtual void onServerHandshakeSuccess()
unsigned int getSocketDescriptor() override
void handleConnect(const asio::error_code &ec, const asio::ip::tcp::endpoint &endpoint) override
unsigned short getSenderEndpointPort() override
void handleTcpResolve(const asio::error_code &ec, const asio::ip::tcp::resolver::results_type &endpoints) override
static void logClientHandshakeResult(SSL *ssl, const std::string &hostname, const asio::error_code &ec)
Logs a client handshake's outcome: the TLS version and cipher, or why the server certificate was reje...
void doHandshake(unsigned int timeoutSeconds=0)
Starts the server side handshake.
void connect(const std::string &address, unsigned short port) override
asio::error_code bind(const asio::ip::address &address, unsigned short port) override
Note: The following API's are thread safe and queue the request to be handled by the ioService thread...
void transportClose() override
void handleClientHandshake(const asio::error_code &ec, const asio::ip::tcp::endpoint &endpoint) override