fix(NetSSL_Win): Error during handshake: failed to read data (#4275)

Closes #3944
This commit is contained in:
Tavi Cacina 2023-11-23 02:57:01 +01:00 committed by GitHub
parent 4a9285c997
commit b34801f4ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}