I am working on TLS 1.2 client. The client fails to establish security context with server. It is sending ClientHello with certain set of extensions. Then it receives multiple messages from server: ServerHello
, Certificate
, Server Key Exchange
, CertificateRequest
and Server Hello Done
. After that client resets the connection with error code unexpected_message
.
Chrome browser establishes security context with the same target host just fine. I see it is sending much more extensions in its ClientHello
message.
How can I add extensions to my ClientHello message additionally to the ones inserted by default? Client is in C++, it uses Schannel to communicate with server, and multiple calls to the function InitializeSecurityContext()
from sspi.h
to establish security context.
Small sample of C++ code snipped is well appreciated, as well as any advices which may help me to understand what is wrong with the client.