The issue is in this line: https://github.com/arduino/ArduinoCore-renesas/blob/c0f158f1e0a536de76a06163bc14d19f649ba33a/libraries/SSLClient/src/SSLClient.cpp#L380 Only the least significant byte of the key ID is stored. The key ID should be stored in 4 bytes, big endian.