Skip to main content
Open topic with navigation CAPL Functions » TLS API » HasEarlyDataBeenAccepted

HasEarlyDataBeenAccepted

Valid for: CANoe DE

Function Syntax

long HasEarlyDataBeenAccepted(dword socket)

Description

To check if the early data has been accepted by the TLS 1.3 server, this function should be called, but only after a successful TLS handshake. In case the TLS 1.3 server has rejected the early data, the TLS 1.3 client can send the data again, encrypted with the application traffic keys.

Parameters

  • socket: The socket handle.

Return Values

  • 0: The early data was not received or refused by the server.
  • 1: The early data was received by the server.

Example

void OnTlsHandshakeComplete(dword socket, int result)
{
  if (result == 0)
  {
    if(tlsHasEarlyDataBeenAccepted(socket) == 1)
    {
      //
      // Early data has been accepted.
      //
    }
    else
    {
      //
      // Early data has been rejected. Maybe send the data again.
      //
    }
    // ...
  }
}
tlsAuthenticateAsClientWithConfigurationAndEarlyDataOnTlsEarlyDataReceived