开发者

Easiest way to add SSL to a IOCP based windows server?

I have a IOCP based server which we have used for long time. Now we need to add SSL support to this. I am struggling to find a clean solution. I have found two options suggested in the other two threads -

1) Use openssl Memory BIO - but have not found any examples on the net that work with IOCP ports which explain the issues that will arrise due to the multi threaded nature of I开发者_Go百科OCP. 2) Use Boost ASIO with ssl - which i think uses IOCP internally. But there are no examples that show how per connection state data can be stored - for example in our server there is state information stored for each client that is connected , this state information is used to recognise the client and parse sent by client data accordingly.

I would be really grateful if you could suggest a solution to the above two problems or any other solution that has worked for you.

UPDATE : I am using Simple C to implement IOCP in winsock2 library.

Best Regards Niladri


See my answer here: How do I use OpenSSL with WinSock?

I wrote an article which has code for using OpenSSL with async sockets. The article's code shows MFC's async sockets but the theory is the same for IOCP.

I used a variation on the design presented in the article for the OpenSSL support that's available as part of my IOCP based server framework; see here: http://www.serverframework.com/products---the-ssltls-using-openssl-option.html.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜