I wrote a simple web server using socket(), listen(), bind() and friends and now want to add SSL or TSL options, but can't find any info on how to do that. I looked at the option flags that can be set on a socket, no luck there. Googled many different combinations of "Secure BSD sockets" "secure sockets" etc but got nothing stating clearly how to either secure an existing socket or how to create a new secure socket.

Does anyone know how to do this? Or know of a good link that spells out, step by step, how to create a secure socket?

Any help greatly appreciated