Skip to content

Commit 84adc73

Browse files
committed
- don't throw if SSL client unexpectedly closes connection as this seems to be the normal behavior of web browsers (seen with Chrome and IE)
1 parent edf4645 commit 84adc73

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

NetSSL_OpenSSL/src/SecureSocketImpl.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,15 @@ int SecureSocketImpl::handleError(int rc)
433433
long lastError = ERR_get_error();
434434
if (lastError == 0)
435435
{
436-
if (rc == 0 || rc == -1)
436+
if (rc == 0)
437+
{
438+
// Most web browsers do this, don't report an error
439+
if (_pContext->isForServerUse())
440+
return 0;
441+
else
442+
throw SSLConnectionUnexpectedlyClosedException();
443+
}
444+
else if (rc == -1)
437445
{
438446
throw SSLConnectionUnexpectedlyClosedException();
439447
}

0 commit comments

Comments
 (0)