Hacker News new | ask | show | jobs
by X-Istence 5128 days ago
Not sure if you can do this in Ruby, but instead of using OpenSSL to manage the socket use something like libevent or event handling to pass the information to a SSL memory BIO...

I wrote an article[1] on this a while back (C++ code), but it should give you an idea as to how to accomplish this. Do note that it looks complicated at first, but it is fairly easy to implement.

Code based on what is in that article has been in production service for about 4 months now and it is completely stable. No weird errors, no weird issues, nothing.

Also, if you let something like OpenSSL causing issues kill your startup dead in its tracks you need to reconsider what MVP is... restart it every so often if it becomes an issue, fork a different process like netcat that does the SSL instead and use pipes to communicate. Please don't let issues with SSL kill your product!

[1]: http://funcptr.net/2012/04/08/openssl-as-a-filter-(or-non-bl...