I want to use 1 port for both unencrypted TCP and SSL.
The goal is to make 1 port the entrance to the machine. That mean to mux all protocols and transports into the port. For example, i peek at the first 4 bytes of the stream. If it begins with 'GET', 'POST', 'HEAD', etc. I know that it is the HTTP protocol so I pass off the connection to the HTTP server. If it is 'HELO' or 'EHLO' i know to pass it off to the SMTP server.
The problem is, what do I look for if it is an SSL connection (in order to pass it off to OpenSSL)?