Here's some pseudocode
Client:
boolean sent = false;
byte[] message = new String("test").getBytes();
send()
{
sent = sslSocket.sendMessage(message);
if (sent)
sslSocket.close();
}
I'm writing tests that should be fairly quick. Once the Client successfully sends a message, it should close immediately. In my tests, the Client returns sent == true, so the socket closes. However, the Server is throwing a received close_notify during handshake exception. This exception does not happen when I use Thread.sleep(200) right before closing the Client.
Our sockets are our own abstractions and wrappers for Java's sockets. From this post, I have to assume that the Server has not completed the handshake, but the Client has? Why else would sent return true? I can't confirm that the message actually HAS been received by the Server, however, because the exception is thrown immediately. I only have Client sent boolean to rely on.
So my question is how can I confirm the handshake was completed?
Thank you for the help, and sorry for any ambiguity! I can clear any confusions!