-
December 30th, 2009, 11:13 PM
#1
Programming socket IOCP with OpenSSL
Hi all,
I'm current deverlop a server which use asyn socket (use IOCP), and now i want to add OpenSSL authentication in my socket. But in my socket, methold WSASend() don't like methold SSL_write which I used.
Do you have any idea for me?
Thanks in advance!!
-
December 31st, 2009, 02:45 AM
#2
Re: Programming socket IOCP with OpenSSL
http://linux.die.net/man/3/bio_s_bio
One typical use of BIO pairs is to place TLS/SSL I/O under application control, this can be used when the application wishes to use a non standard transport for TLS/SSL or the normal socket routines are inappropriate.
Last edited by Grober; December 31st, 2009 at 02:54 AM.
-
January 4th, 2010, 12:00 AM
#3
Re: Programming socket IOCP with OpenSSL
Thanks for reply,
Can you explain about BIO pairs and how to use it with WSASend() and WSARecv()?
Best regards,
-
January 5th, 2010, 11:28 AM
#4
Re: Programming socket IOCP with OpenSSL
[Referring to the example code from the BIO_s_bio manpage]
After WSARecv completion make the data available to the SSL engine by using BIO_write(network_bio, ..., ...).
With BIO_read(network_bio, ..., ...) you can read the data from the engine and send it via WSASend.
Last edited by Grober; January 6th, 2010 at 11:41 AM.
-
January 14th, 2010, 04:53 AM
#5
Re: Programming socket IOCP with OpenSSL
I wrote an article for Windows Developer Magazine back in 2002 which showed how to use OpenSSL BIO pairs to write an SSL adapter for an MFC async socket. The article and code are here: http://www.lenholgate.com/archives/000456.html. This should show you what you need to do to use overlapped IOCP sockets with OpenSSL - in fact this was the test project which I developed whilst working on the ideas that eventually went into our licensed IOCP framework's OpenSSL support (see here (http://www.lenholgate.com/ServerFram...licensing.html), if you're interested in the framework)
-
January 14th, 2010, 11:14 AM
#6
Re: Programming socket IOCP with OpenSSL
Your example shows the usage of memory bio.
-
January 14th, 2010, 11:25 AM
#7
Re: Programming socket IOCP with OpenSSL
That's true, either way, it works and the example provides a compilable and working solution to the problem which is equally applicable to the IOCP situation.
I seem to remember that there was an issue with using a BIO pair at the time; but looking at the man page now it seems that perhaps it was simply that I didn't understand that you needed to free the network bio yourself but that the internal bio was freed for you... It was a long time ago...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|