Re: Proposed patch to add SSL support to net/pop.rb

From: Austin Ziegler <austin@...>
Date: 2004-04-01 18:03:58 UTC
List: ruby-core #2733
On Wed, 31 Mar 2004 13:27:31 +0900, Daniel Hobe wrote:
>> Net::POP3.start(address, port, account, password, isapop = false) {
>> |pop| ... }
>> Net::POP3.start_with_ssl(address, port, account, password, certs,
>> verify, isapop = false) { |pop| ... }
> That might work.
> What about the case where I want a client that can do either POP or POP
> over SSL depending on a users input?  In the first case I just set usessl
> = true and pass that to #start.  In this case I have to call a whole
> separate method.  This seems less elegant to me.

Perhaps a third method could be provided that could serve this dual-duty.

Alternatively:

Net::POP3.start(address, port, account, password, isapop = false) { |pop|
  pop.use_ssl(certs, verify)
  ...
}

I'm not sure how that would work in the implementation, but it would 
effectively replace/restart the connection if you call #use_ssl.

-austin
--
austin ziegler    * austin@halostatue.ca * Toronto, ON, Canada
software designer * pragmatic programmer * 2004.04.01
                                         * 12.58.48




In This Thread