I have a 2 threads application. One GUI thread and one worker thread (CWinThread) in which I make time consuming operations - calculations and HTTP comunication.
I have to switch from HTTP to SSL socket connection. I also need to make a verification of server certificate (is it trusted, is it expired, is it revoked)
Which library to use for SSL Socket (MFC, Boost or something else)?
Do I have to use synchronous or asynchronous operations? I think that If I use asynchronous operations I may implement Cancel functionality which may be called from GUI thread.
And If I use asynchronous operations is it better to move socket operations in first thread?
Does SSL protocol support compression of stream data?
For the SSL support - take a look at openssl.org
Cancel support is nice; to do it you have to check on regular basis from the worker thread if cancel was requested. Pay attention to use volatile variable or protected the access to it with a Critical section. Do not do the network operation from the GUI thread, even if it asynchronous. It is a nice policy not to do any kind of IO from the GUI thread to ensure it is responsive and more important, that it won't hang.
+1 for OpenSSL.org
I wrote about integrating OpenSSL with async windows sockets in "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 source code for a simple MFC client that uses OpenSSL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With