Refactor with tests.

Remove reported length to match record in SSL