# Pop3s

**URL:** <https://www.ruby-forum.com/t/pop3s/97388>\
**Category:** Ruby\
**Created:** [July 6, 2006, 7:49pm UTC](https://www.ruby-forum.com/t/pop3s/97388 "2006-07-06T19:49:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandru\_ESUngur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/b5e925/32.png) [@Alexandru\_ESUngur](https://www.ruby-forum.com/u/Alexandru_ESUngur)\
**Post date:** [July 6, 2006, 7:49pm UTC](https://www.ruby-forum.com/t/pop3s/97388/1 "2006-07-06T19:49:45Z")

</div>

Hi all,

Does anybody have any ideea how can I use POP3 with ssl  
from Ruby? I googled all I could and all I found was this  
solution, which is quite outdated, as it references ‘ssl’  
while now the library its being called ‘openssl’.

==== pop3s.rb ==========================  
require ‘net/pop’  
require ‘openssl’

module Net

class POP3S \< POP3  
def POP3S.default\_port  
995  
end

```
def POP3S.socket_type
  Net::SSLSocket
end

def on_connect
  @socket.ssl_connect
end

```

end

end  
==== end ===============================

However this won’t work:

# irb

irb(main):001:0\> require ‘pops.rb’  
=\> true  
irb(main):002:0\> pop = Net::POP3S.new ‘localhost’  
=\> #\<Net::POP3S localhost:995 open=false\>  
irb(main):003:0\> pop.start(‘x’,‘y’)  
NameError: uninitialized constant Net::SSLSocket  
from ./pops.rb:16:in `socket_type' from /usr/local/lib/ruby/1.8/net/pop.rb:438:in`do\_start’  
from /usr/local/lib/ruby/1.8/net/pop.rb:432:in `start’  
from (irb):3  
from /usr/local/lib/ruby/1.8/openssl/digest.rb:37

If I replace Net::SSLSocket with OpenSSL::SSL::SSLSocket  
I get an error about ‘old\_connect undefined’ instead…

Any tips/help are greatly appreaciated,  
Thank you,  
Alex
