I'm trying to get FTPFXP to work on Ruby 2.0 (so I can FTP over TLS)
I'm having problems with this line, which sets up the SSL Socket. OpenSSL checks whether @sock
is a T_FILE
In Ruby 1.9.3, it worked well, because it was just a TCPSocket
but in Ruby 2.0, @sock
becomes a Net::FTP::BufferedSocket
.
It's easy enough to change the code in https://github.com/codeodor/ftpfxp/blob/06f2d56e65e73d3818b6c7aef4dfe461bad98849/lib/ftpfxp/ftpfxptls.rb#L87 to send @sock.io
to make it a TCPSocket
again, but when Net::FTP
tries to close the socket, it expects the socket to have a read timeout, which I'm guessing BufferedSocket
has, but a TCPSocket
does not.
So, a few questions:
- Should a
Net::FTP::BufferedSocket
be aFile
? - Should Net::FTP be assuming it has a
BufferedSocket
at all times? - Should TCPSocket implement
read_timeout
?
I guess the broader question is: what is the appropriate fix? Obviously I'll need to work around it in my code, but is this something that should be fixed in Ruby, and if so, where?
Thanks for your help!
I guess my first goal now is to get it to retrieve more than the 1st block, even if I have to monkeypatch stuff. Obviously prefer not to, but I need to make it work more than I need to make it pretty.
However, if problem is indeed from Ruby stdlib, then I'd love to figure it out and submit a pull request to fix it.