From: "Iñaki Baz Castillo" Date: 2011-12-02T19:22:19+09:00 Subject: Using OpenSSL for making a network TLS server Hi, Ruby EventMachine has some issues in its TLS implementation (coded in C++ using OpenSSL) as noted in https://github.com/eventmachine/eventmachine/issues/266. I've been suggested by the author of the project to make a TLS stack on pure Ruby (by using OpenSSL) and I want to start with it. I'd like to ask some very basic questions so I can investigate how to achieve it: - Imagine that a Ruby server receives a TLS connection from a client. I assume that my server must implement the TLS handshake protocol at pure Ruby level, this is, OpenSSL will not help me with this, am I right? - Once such TLS handshake is started, I could receive a certificate from the client, such certificate must be parsed "manually" at Ruby level in the server (OpenSSL will not help me with this),am I right? - I must also send my certificate(s) to the peer (again at Ruby level). - After previous steps, I expect that TLS connection is done so I will receive data from the client. And I should process/decrypt such data by using some OpenSSL::XXXXXXX instance and method, am I right? - And in case I reply data to the client, I must first encrypt the data using some OpenSSL::XXXXXXXX instance and method, and then send the generated data to the client, am I right? Thanks a lot for any input that helps me starting with this stuff. -- Iñaki Baz Castillo