I've a plan to add the encryption to my server/client communication by using OpenSSL. But I want to let the user choose if they want to use the SSL channel to communicate or not. The easiest way is just create 2 socket and bind them to a different port, but I want the server to serve the service on only one port.
Is there anyway to open the server side's SSL socket that support both SSL and non-SSL communication regarding the client incoming connection?
P.S. I use OpenSSL lib for my c++ code.