TLS CAPL Functions
CAPL Functions » TLS CAPL Functions Valid for: CANoe DE • CANoe4SW DE The TLS API provides functions for encrypting a socket connection (see TCP/IP CAPL Functions). Please be aware that the following CAPL functions can only be used when there is no AUTOSAR Eth or SOME/IP interaction layer assigned. Otherwise, you have to use the corresponding functions defined in the AUTOSAR Eth or SOME/IP interaction layer for TLS. To use the CAPL Transport Layer Security (TLS) functions, you must add a profile in the [Vector Security Manager](javascript:startCANoeSubToolLauncherEN(‘Security Manager’,‘HELP:VectorSecurityManager.md’)). This TLS profile is used in the tlsAuthenticateAsClientWithConfiguration and tlsAuthenticateAsServerWithConfiguration functions. Please also use the sample configuration TCP Chat (CAPL) with TLS encryption for reference.Functions
- HasEarlyDataBeenAccepted: 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.
- tlsAuthenticateAsClientWithConfiguration: Starts the (D)TLS authentication handshake as client.
- tlsAuthenticateAsClientWithConfigurationAndEarlyData: TLS 1.3 allows clients to send encrypted data to the server right after the ClientHello message on the first flight (“early data”) with the performance-enhancing feature zero round trip time resumption (0-RTT).
- tlsAuthenticateAsServerWithConfiguration: Starts the (D)TLS authentication handshake as server.
- tlsClose: Closes a TLS socket.
- tlsGetLastError: Returns the TLS error code of the last operation that failed on a specified TLS socket.
- tlsGetLastErrorAsString: Retrieves the error message of the last operation that failed on a specified TLS socket.
- tlsOpen: Opens a TLS socket.
Callbacks
- OnDtlsServerConnect: This callback is called when a new DTLS client connects to the DTLS server.
- OnObservedAndDecryptedTlsApplicationData: This callback is called when observed and decrypted TLS application data is available.
- OnObservedAndDecryptedTlsHandshakeData: This callback is called when observed TLS handshake data is available.
- OnTlsClose: This callback is called when the peer closes the TLS connection while a receive call is pending.
- OnTlsEarlyDataReceived: To handle early data from the TLS 1.3 client, the CAPL server program must implement this callback.
- OnTlsHandshakeComplete: This callback is called when a TLS socket completes its handshake.