danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Improve kTLS fail management #375

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

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.