mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
pass better information about TLS handshake failures
This commit is contained in:
@@ -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";
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user