I have something like this here:
irc = TCPSocket.open(@server_name, @port)
ssl_context = OpenSSL::SSL::SSLContext.new
ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
irc = OpenSSL::SSL::SSLSocket.new(irc, ssl_context)
irc.sync = true
Does not work as is though.
Does one of you have a working example of using ruby openssl
and a socket?
I wrote a tiny IRC class, which connects to IRC, then it
allows me to talk there. I would like to add openssl
support, but I can not figure it out.
The above code failed via:
in `connect’: SSL_connect returned=1 errno=0 state=unknown state:
unknown protocol (OpenSSL::SSL::SSLError)
And the official documentation to ruby-openssl is just absolutely awful,
in my opinion.