RE: Encrypted and unencrypted handshaking

2007-06-08 Thread David Schwartz
> Hey! Seems that recv(,,, MSG_PEEK); worked just fine for what I > wanted to do! > > Thanks for your help guys! :-) > > > What if your recv(,,,MSG_PEEK) only returns one byte? > > OK, will be enough. If you can make the decision with just one byte, I believe you are okay. DS _

Re: Encrypted and unencrypted handshaking

2007-06-08 Thread João Fernandes Simplício
Hey! Seems that recv(,,, MSG_PEEK); worked just fine for what I wanted to do! Thanks for your help guys! :-) On 6/9/07, Marek Marcola <[EMAIL PROTECTED]> wrote: Hello, > > For example if client connects, you may recv(,,,MSG_PEEK) 5 bytes > > from client socket and check if this bytes are valid

RE: Encrypted and unencrypted handshaking

2007-06-08 Thread Marek Marcola
Hello, > > For example if client connects, you may recv(,,,MSG_PEEK) 5 bytes > > from client socket and check if this bytes are valid SSL2/SSL3/TLS1 > > record header (SSL2 and SSL3/TLS1 record headers are different). > > If yes, then you can call SSL_accept() on client socket > > if not, you can r

RE: Encrypted and unencrypted handshaking

2007-06-08 Thread David Schwartz
> For example if client connects, you may recv(,,,MSG_PEEK) 5 bytes > from client socket and check if this bytes are valid SSL2/SSL3/TLS1 > record header (SSL2 and SSL3/TLS1 record headers are different). > If yes, then you can call SSL_accept() on client socket > if not, you can read()/write() T

Re: Encrypted and unencrypted handshaking

2007-06-08 Thread Marek Marcola
Hello, > I would like to know if it is possible to have a port listening for > both SSL and plain-text connections, and if yes... with what library > functions can I achieve this? > Example: > > - Port 12345 listening; > - Client connects to port; > - Server checks if it is requested a SSL or plai

Encrypted and unencrypted handshaking

2007-06-08 Thread João Fernandes Simplício
Hello, I would like to know if it is possible to have a port listening for both SSL and plain-text connections, and if yes... with what library functions can I achieve this? Example: - Port 12345 listening; - Client connects to port; - Server checks if it is requested a SSL or plain-text; - Serv