refactor add ssl read write single implementation

Signed-off-by: Andy Green <andy.green@linaro.org>
refactor use unified ssl read write functions

Signed-off-by: Andy Green <andy.green@linaro.org>