set application buffer size to not exceed tls record size and handle buffer overflow condition.
Merge pull request #2914 from eminn/fix/ssl

set application buffer size to not exceed tls record size and handle buf...