Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/internal/sio_client_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ namespace sio

#undef SYNTHESIS_SETTER



void clear_con_listeners()
{
Expand Down Expand Up @@ -188,6 +189,14 @@ namespace sio
void update_ping_timeout_timer();

#if SIO_TLS
std::function<bool(bool, websocketpp::lib::asio::ssl::verify_context&)> verify_callback_cb;

template <typename VerifyCallback>
void set_tls_verify_callback(VerifyCallback callback)
{
verify_callback_cb = callback;
}

typedef websocketpp::lib::shared_ptr<asio::ssl::context> context_ptr;

context_ptr on_tls_init(connection_hdl con);
Expand Down
9 changes: 9 additions & 0 deletions src/sio_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ namespace sio
m_impl->set_proxy_basic_auth(uri, username, password);
}

#if SIO_TLS
void client::set_tls_verify_callback(std::function<bool(bool, websocketpp::lib::asio::ssl::verify_context&)> callback)
{
if (m_impl) {
m_impl->set_tls_verify_callback(callback);
}
}
#endif

void client::connect(const std::string& uri)
{
m_impl->connect(uri, {}, {}, {});
Expand Down
8 changes: 8 additions & 0 deletions src/sio_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
#include "sio_message.h"
#include "sio_socket.h"

#if SIO_TLS
#include "websocketpp/config/asio_client.hpp"
#endif

namespace asio {
class io_context;
}
Expand Down Expand Up @@ -61,6 +65,10 @@ namespace sio
void clear_con_listeners();

void clear_socket_listeners();

#if SIO_TLS
void set_tls_verify_callback(std::function<bool(bool, websocketpp::lib::asio::ssl::verify_context&)> callback);
#endif

// Client Functions - such as send, etc.
void connect(const std::string& uri);
Expand Down
Loading