SSL socket on Windows. Library? Synchronous / asynchronous? Streams?

I have an application with two threads. One GUI thread and one worker thread (CWinThread), in which I perform multi-user operations - computing and communication with HTTP.

I need to switch from HTTP to SSL socket connection. I also need to do a server certificate verification (it is trusted, it has expired, it has been canceled )

  • What library to use for SSL Socket (MFC, Boost or something else)?

  • Do I need to use synchronous or asynchronous operations? I think that if I use asynchronous operations, I can implement the Cancel function, which can be called from the GUI thread.

  • And if I use asynchronous operations, is it better to move socket operations in the first thread?

  • Does SSL support stream compression?

+3
source share
3 answers

For SSL support - look at openssl.org

Cancellation of support is good; for this you need to check regularly from the workflow if cancellation was requested. Note the use of a volatile variable or secure access to it using the Critical section. Do not perform a network operation from a GUI thread, even if it is asynchronous. It is a good policy not to do any I / O from the GUI thread, to ensure that it is responsive and more important, so that it does not hang.

+2
source

+1 for OpenSSL.org

I wrote about the integration of OpenSSL with asynchronous windows in the Windows Developer Magazine back in 2002, and the article can be found here: http://www.serverframework.com/asynchronousevents/2010/10/using-openssl-with-asynchronous-sockets .html , which includes the source code for a simple MFC client that uses OpenSSL.

+1
source

Here is another free SOcketPro library:

http://www.udaparts.com/document/articles/demome.htm

Rgds, moster67

0
source

All Articles