Question

I've scoured the web and have not found anything for this...

Does anyone have a simple code sample of using WinSock with OpenSSL? I am looking for a simple Visual C++ 2005 or greater code sample that creates and opens a winsock connection and applies the necessary SSL settings using OpenSSL and frees all resources appropriately.

Was it helpful?

Solution

Back in 2002 I wrote an article for Windows Developer Magazine that showed how to use OpenSSL to provide SSL for MFC's CAsyncSocket. The code and article and might help you though it does go further than you might need in that the main focus is not the winsock integration but using OpenSSL with asynchronous winsock. I've used this as the basis of integrating OpenSSL with an I/O completion based high performance winsock server.

OTHER TIPS

http://unick-soft.ru/Articles.cgi?id=10 But sorry, it is Russion Article, but have C++ Example for Https-client and smpts-client.

I think you should read these tutorials by Thunked OpenSSL Tutorial - Client and OpenSSL Tutorial - Server

They use Winsock API

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top