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?

Cheers, Badda


David Schwartz wrote:
> 
> 
> There are right ways and there are easy ways. The easy way is to
> non-destructively read the first character on the connection. If it is 'G'
> or 'P', assume plaintext, if not, assume SSL and build (or don't build) an
> SSL connection accordingly.
> 
> DS
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-back-received-data-after-SSL_accept%28%29---tf4054540.html#a11522449
Sent from the OpenSSL - User mailing list archive at Nabble.com.

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

Reply via email to