Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does a server know that it recieved an SSL close notify?

Tags:

ssl

openssl

I will use materials from here for it helps to clarify the question.

The image below represents a SSL session flow

enter image description here

The description for step 7 states:

When either the client or the server is ready to end the connection, both the client and the server issue the SSL_shutdown() function to indicate that the SSL connection is ending normally. This causes an SSL record whose type is alert to flow. For this, the type of alert is close notify, which means the SSL session is ending.

Given that the server is just and echo server with SSL that has a while(1) inside which it reads and writes the same back to the client.

What openSSL command needs to be run on the server so that it understands that the client sent a close notify and that it isn't just some message it should echo?

In the quote how does one express both the client and the server issue the SSL_shutdown() with code? Would expect either one to send a close notify and the other to respond as a reaction to it.

like image 549
TheMeaningfulEngineer Avatar asked Oct 15 '25 14:10

TheMeaningfulEngineer


1 Answers

close_notify manifests itself to the recipient as end of stream when reading, same as read() returning 0 on a C plaintext socket.

like image 99
user207421 Avatar answered Oct 18 '25 07:10

user207421