Try looping until we get underflow back from SSL Engine
Also exit the loop if the SSL connection is closed