Hello,
> David,
> Perfect - thanks!
> Peeking at the first byte with recv(sock, buffer, 1, MSG_PEEK) works :-)
> I'm not very familiar with the SSL handshake. What are the chances of a "G"
> or "P" being the first byte of the handshake itself?
This is not good solution, what if you get OPTIONS, HEAD and many more
HTTP keywords ?  What if new HTTP keywords will be created in the
feature ? You will have deadlock.
Get first byte and check if this byte is 0x16 (SSL3/TLS1 handshake
packet) or 0x80 (SSL2 handshake packet) and if you will get one
of these, run SSL negotiation, otherwise process clear HTTP request.

Best regards,
-- 
Marek Marcola <[EMAIL PROTECTED]>

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to