diff --git a/websocketpp/transport/asio/security/base.hpp b/websocketpp/transport/asio/security/base.hpp index 7e003794c6..7003452bde 100644 --- a/websocketpp/transport/asio/security/base.hpp +++ b/websocketpp/transport/asio/security/base.hpp @@ -95,7 +95,10 @@ namespace error { pass_through, /// Required tls_init handler not present - missing_tls_init_handler + missing_tls_init_handler, + + /// TLS Handshake Failed + tls_handshake_failed, }; } // namespace error @@ -119,9 +122,11 @@ public: case error::tls_handshake_timeout: return "TLS handshake timed out"; case error::pass_through: - return "Pass through from underlying library"; + return "Pass through from socket policy"; case error::missing_tls_init_handler: return "Required tls_init handler not present."; + case error::tls_handshake_failed: + return "TLS handshake failed"; default: return "Unknown"; } diff --git a/websocketpp/transport/asio/security/tls.hpp b/websocketpp/transport/asio/security/tls.hpp index 4f383e5a27..9b884ceef7 100644 --- a/websocketpp/transport/asio/security/tls.hpp +++ b/websocketpp/transport/asio/security/tls.hpp @@ -260,11 +260,10 @@ protected: m_hdl = hdl; } - void handle_init(init_handler callback, const - boost::system::error_code& ec) + void handle_init(init_handler callback,boost::system::error_code const & ec) { if (ec) { - m_ec = socket::make_error_code(socket::error::pass_through); + m_ec = socket::make_error_code(socket::error::tls_handshake_failed); } else { m_ec = lib::error_code(); } @@ -284,7 +283,7 @@ protected: void async_shutdown(socket_shutdown_handler callback) { m_socket->async_shutdown(callback); } - + /// Translate any security policy specific information about an error code /** * Translate_ec takes a boost error code and attempts to convert its value