This PR changes how failures in enabling kTLS are managed, now instead of refusing the connection it falls back to use the standard mbedtls.
As a kTLS error is not an hard error, switch to try set the socket options instead of expecting that the operation has to succeed. If it fails, it simply go ahead with the fallback to mbedtls.
As part of the changes, now the mbedtls session context is freed only when the connection is closed, this to have access to the peer certificate if sent by the client at any time during the life of the connection.
This PR changes how failures in enabling kTLS are managed, now instead of refusing the connection it falls back to use the standard mbedtls.
As a kTLS error is not an hard error, switch to try set the socket options instead of expecting that the operation has to succeed. If it fails, it simply go ahead with the fallback to mbedtls.
As part of the changes, now the mbedtls session context is freed only when the connection is closed, this to have access to the peer certificate if sent by the client at any time during the life of the connection.