I need a minimal SSL server and came up with the following:
confirm(WSAStartup(MakeWord(1,1), WData) = 0);
SSL_library_init;
SSL_load_error_stri
You need to remember, that TCP is stream-based, and single call to Read can return whatever piece of data it can, and this can be for example half of the header, or a header + a bit of the post data or anything between. You can't expect one read to return the complete data.
Consequently your only option is the following algorithm:
If I were you, I would take some existing HTTP/HTTPS server implementation. Obvious options are Indy + SSL layer or HTTPBlackbox server package of our SecureBlackbox.
I modified OpenSSL s_server.c, which now does the trick, and posted it as the answer to Question 7080958.