They aren't the same. The status returned as SSLEngineResult.getHandshakeStatus()
by calling wrap()
or unwrap()
can include FINISHED, but you will never get that from the status stored in the SSLEngine.
The reason is that it's a transient status.
NB poor quality code. There's not much point in trying an unwrap or anything else after you've just read end of stream.