[v10.x] tls: group chunks into TLS segments
Backport of #27861 (and also #27891 and #28903 to fix tests).
The original code uses AllocatedBuffer
, so we would need to also backport #26207 (specifically 6c257cdf). Instead I've defined it as vector<char>
which has almost identical API; are these changes okay for backports?