views:

677

answers:

2

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.

+3  A: 

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 are here: http://www.lenholgate.com/archives/000456.html 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 (see here: http://www.lenholgate.com/archives/000835.html ).

Len Holgate
I got it working, your articles had some useful bits, thanks!
John JJ Curtis
No problem, glad you solved your problem.
Len Holgate
A: 

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