Issue #15318 has been updated by karis10 (bug reporter).


ahorek (Pavel Rosick) wrote:
> It wasn't intentional, but I think you shouldn't depend on TCPSocket anyway.
> 1/ Net::IMAP doesn't expose @socket in a public api
> 2/ it isn't documented that Net::IMAP will always use TCPSocket

One more comment about it if you don't mind. Internal interfaces being created for some reason, and there was a reason to create TCPSocket, such as proxification. We are talking about standard library, not ruby internal structures which is understandable can be rewritten and refactored. So it's normal to override and extend even standard library code through interface, it's how ruby offers code reuse and DRY. You are right, there is no documentation about TCPSocket and any guarantees it will remain so, but it's a bit late to break something after keeping it in a known way until 2.5 release. Thank you.


----------------------------------------
Bug #15318: net/imap socket backward compatibility broken in ruby 2.5+
https://bugs.ruby-lang.org/issues/15318#change-74955

* Author: karis10 (bug reporter)
* Status: Feedback
* Priority: Normal
* Assignee: shugo (Shugo Maeda)
* Target version: 
* ruby -v: 
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN
----------------------------------------
Hi,
I use net/pop and net/imap libraries and sometimes I need my pop/imap connections to be socksified or proxified (through TCPSocket initialize method modifications: https://github.com/Shopify/socksify-ruby). Upgrading to ruby 2.5.3 from 2.4.4 I've found that TCPSocket interface was changed in favor of raw sockets by this patch: https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/58549/diff/lib/net/imap.rb the reason was this issue: https://bugs.ruby-lang.org/issues/13379

And after migrating from 2.4.4 to 2.5.3 and a bit of debugging I've found that standard library behavior was internally _silently_ broken. In 2.5.3 net/pop library still can be normally proxified, but not net/imap.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>