TLS 1.3 using SChannel - DecryptMessage Failed with CONTEXT EXPIRED

Ajaykumar Jaiswal 6 Reputation points

Do we have example client/server programs in C/C++ for implementing TLS 1.3 using SChannel?

DecryptMessage() function first initial call return SEC_I_RENEGOTIATE and when we reinitiate the connection it get expire and connection close.

If you could help, handling renegotiate requests from server (Ex: SEC_I_RENEGOTIATE).


Regards: Ajay

Windows Server Security
Windows Server Security
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.Security: The precautions taken to guard against crime, attack, sabotage, espionage, or another threat.
1,777 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,918 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ポカリ 0 Reputation points

    I also suffered from the same problem.

    If SEC_I_RENEGOTIATE is received when using TLS1.3

    1.Prepare OutSecBuff and InSecBuff and pass the received data to InitializeSecurityContext.

    2-1 If SEC_E_OK and there is no SECBUFFER_EXTRA buffer in OutSecBuff, receive the next packet and call Decryptmessage.

    2-2 If SEC_E_OK and OutSecBuff has a SECBUFFER_EXTRA buffer, pass the SECBUFFER_EXTRA buffer to Decryptmessage.

    If you are still looking for this information, please let me know your results.



    0 comments No comments