netxduo icon indicating copy to clipboard operation
netxduo copied to clipboard

ISSUE : TLS client handshake with PSK

Open EdouardMALOT opened this issue 2 years ago • 0 comments

I'm trying to connect to an MQTT broker using TLS with a PSK key. Since the device is a client, I first configured the key with the nx_secure_tls_client_psk_set(), but the connection failed.

For this to work, I need to call the nx_secure_tls_psk_add() and the nx_secure_tls_client_psk_set() to configure the PSK. (which doesn't seem right to me)

image

The issue seems to be linked to the _nx_secure_tls_psk_find() function, which is called during the handshake.

image

This function searches for keys in the nx_secure_tls_psk_store[] array, but this array is not filled when nx_secure_tls_client_psk_set() is called. (But it is filled when nx_secure_tls_psk_add() is called). image

It seems to me that the _nx_secure_tls_psk_find() function should look for the key in "nx_secure_tls_credentials.nx_secure_tls_client_psk.nx_secure_tls_psk_data" when the device make a client handshake :

image

EdouardMALOT avatar Oct 23 '23 06:10 EdouardMALOT