ConnStateData::handleSslBumpHandshakeError(const Security::IoResult &handshakeResult)
{
    auto errCategory = ERR_NONE;

    switch (handshakeResult.category) {
    case Security::IoResult::ioSuccess: {
        static const auto d = MakeNamedErrorDetail("TLS_ACCEPT_UNEXPECTED_SUCCESS");
        updateError(errCategory = ERR_GATEWAY_FAILURE, d);
        break;
    }

    case Security::IoResult::ioWantRead: {
        static const auto d = MakeNamedErrorDetail("TLS_ACCEPT_UNEXPECTED_READ");
        updateError(errCategory = ERR_GATEWAY_FAILURE, d);
        break;
    }

    case Security::IoResult::ioWantWrite: {
        static const auto d = MakeNamedErrorDetail("TLS_ACCEPT_UNEXPECTED_WRITE");
        updateError(errCategory = ERR_GATEWAY_FAILURE, d);
        break;
    }

    case Security::IoResult::ioError:
        debugs(83, (handshakeResult.important ? DBG_IMPORTANT : 2), "ERROR: " << handshakeResult.errorDescription <<
               " while SslBump-accepting a TLS connection on " << clientConnection << ": " << handshakeResult.errorDetail);
        updateError(errCategory = ERR_SECURE_ACCEPT_FAIL, handshakeResult.errorDetail);
        break;

    }

    if (!tunnelOnError(HttpRequestMethod(), errCategory))
        clientConnection->close();
}
ConnStateData::handleSslBumpHandshakeError(const Security::IoResult &handshakeResult)
{
    auto errCategory = ERR_NONE;

    switch (handshakeResult.category) {
    case Security::IoResult::ioSuccess: {
        static const auto d = MakeNamedErrorDetail("TLS_ACCEPT_UNEXPECTED_SUCCESS");
        updateError(errCategory = ERR_GATEWAY_FAILURE, d);
        break;
    }

    case Security::IoResult::ioWantRead: {
        static const auto d = MakeNamedErrorDetail("TLS_ACCEPT_UNEXPECTED_READ");
        updateError(errCategory = ERR_GATEWAY_FAILURE, d);
        break;
    }

    case Security::IoResult::ioWantWrite: {
        static const auto d = MakeNamedErrorDetail("TLS_ACCEPT_UNEXPECTED_WRITE");
        updateError(errCategory = ERR_GATEWAY_FAILURE, d);
        break;
    }

    case Security::IoResult::ioError:
        debugs(83, (handshakeResult.important ? DBG_IMPORTANT : 2), "ERROR: " << handshakeResult.errorDescription <<
               " while SslBump-accepting a TLS connection on " << clientConnection << ": " << handshakeResult.errorDetail);
        updateError(errCategory = ERR_SECURE_ACCEPT_FAIL, handshakeResult.errorDetail);
        break;

    }

    if (!tunnelOnError(HttpRequestMethod(), errCategory))
        clientConnection->close();
}