Skip to content

Commit

Permalink
fix(NetSSL_Win): Error during handshake: failed to read data (#4275)
Browse files Browse the repository at this point in the history
Closes #3944
  • Loading branch information
tavi-cacina authored Nov 23, 2023
1 parent 4a9285c commit b34801f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions NetSSL_Win/src/SecureSocketImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@ void SecureSocketImpl::initCommon()
{
_contextFlags |= ISC_REQ_MANUAL_CRED_VALIDATION;
}

if (_mode == MODE_CLIENT)
{
// If we do not set this, in some cases the InitializeSecurityContext() will return SEC_I_INCOMPLETE_CREDENTIALS.
// That case is not handled in the handshake, it will try to continue reading, thus blocking until timeout.
// The handling of this case would be to repeat the InitializeSecurityContext once again, or as we do here,
// inform to use a client cert if available.
_contextFlags |= ISC_REQ_USE_SUPPLIED_CREDS;
}
}


Expand Down

0 comments on commit b34801f

Please sign in to comment.