How do you protect a socket with SSL in Ruby when you need to communicate with clear text first?
I cannot use OpenSSL::SSL::SSLServer
, as the client must first request an SSL connection
In short, I am trying to implement RFC3207 where the client sends the keyword "STARTTLS" and then an SSL connection is created.
My question is: "How to create an SSL connection after the server sends" 220 OK "?
I know that I can use OpenSSL::SSL::SSLSocket
on the client side, but I have no idea what to do on the server side
If you know how to do this in a language other than Ruby, just submit the code and I will translate it, I have been working on it for about 8 hours and I need everything I can get
I asked in # ruby-lang, but to no avail, and I tried wrapping Socket objects in SSLSockets on the server and client at the same time, but this does not work either
In short, I'm very stuck, I need all the help I can get
source share