Click here to Skip to main content
14,427,436 members
Rate this:
Please Sign up or sign in to vote.
See more:
In Windows Server System For example in select model openssl use "SSL_read" function to matching with "recv" function, but on the IOCP modle How can I use openssl function to matching with the "WSARecv" function ? Because of in my program have lot of "WSA***" function so that the openssl BIO function may be can not use, what I should do in this condition?


Thanks for you help.

What I have tried:

UINT nRetVal = WSARecv(socket, &m_wsaInBuffer, 1, &dwIoSize, &ulFlags, &pReadOverlap->m_ol, NULL);

what can i do changed into:

int nRetVal = SSL_read(m_pSsl, m_wsaInBuffer.buf,strlen(m_wsaInBuffer.buf) + sizeof(char));
Posted
Updated 5-Jul-17 0:28am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

I wrote an article about this for Windows Developer Magazine back in 2002. You can read it here[^]. The trick is to use a bio pair and to push data through the OpenSSL engine.

You can use a similar design for IOCP based solutions. The trick is to handle your IOCP read completions normally and then push the data into your BIO pair and that routes it through the OpenSSL code and then back to you.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100