Skip to content

Commit

Permalink
Restore EOF_WHILE_READING
Browse files Browse the repository at this point in the history
  • Loading branch information
pepone committed Apr 26, 2024
1 parent fbc6712 commit f4e9f30
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions cpp/src/IceSSL/OpenSSLTransceiverI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,23 @@ OpenSSL::TransceiverI::initialize(IceInternal::Buffer& readBuffer, IceInternal::
}
case SSL_ERROR_SSL:
{
ostringstream os;
os << "SSL error occurred for new " << (_incoming ? "incoming" : "outgoing") << " connection:\n"
<< _delegate->toString() << "\n"
<< _engine->sslErrors();
throw ProtocolException(__FILE__, __LINE__, os.str());
#if defined(SSL_R_UNEXPECTED_EOF_WHILE_READING)
if (SSL_R_UNEXPECTED_EOF_WHILE_READING == ERR_GET_REASON(ERR_get_error()))
{
throw ConnectionLostException(__FILE__, __LINE__, 0);
}
else
{
#endif
ostringstream ostr;
ostr << "SSL error occurred for new " << (_incoming ? "incoming" : "outgoing")
<< " connection:\n"
<< _delegate->toString() << "\n"
<< _engine->sslErrors();
throw ProtocolException(__FILE__, __LINE__, ostr.str());
#if defined(SSL_R_UNEXPECTED_EOF_WHILE_READING)
}
#endif
}
}
}
Expand Down Expand Up @@ -555,7 +567,6 @@ OpenSSL::TransceiverI::getInfo() const
info->incoming = _incoming;
info->adapterName = _adapterName;
info->certs = _certs;
info->host = _host;
return info;
}

Expand Down

0 comments on commit f4e9f30

Please sign in to comment.