dcparker / ruby-gmail

A Rubyesque interface to Gmail. Connect to Gmail via IMAP and manipulate emails and labels. Send email with your Gmail account via SMTP. Includes full support for parsing and generating MIME messages.
http://dcparker.github.com/ruby-gmail
792 stars 123 forks source link

Failure on initialization #6

Closed iwakura closed 14 years ago

iwakura commented 14 years ago

Trying to use gem with Ruby 1.9.1.

g = Gmail.new(login, password)
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
    from /usr/local/lib/ruby/1.9/net/imap.rb:1320:in `connect'
    from /usr/local/lib/ruby/1.9/net/imap.rb:1320:in `start_tls_session'
    from /usr/local/lib/ruby/1.9/net/imap.rb:933:in `initialize'
    from /usr/home/taro/gems/gems/ruby-gmail-0.0.4/lib/gmail.rb:21:in `new'
    from /usr/home/taro/gems/gems/ruby-gmail-0.0.4/lib/gmail.rb:21:in `initialize'
    from (irb):1:in `new'
    from (irb):1
    from /usr/local/bin/irb19:12:in `<main>'

Please suggest solution. Thanks

justinperkins commented 14 years ago

This is actually a problem with Net::IMAP. With Ruby 1.9.1 you can just try out Net::IMAP directly via:

require 'net/imap' Net::IMAP::new('imap.gmail.com', '993', true)

iwakura commented 14 years ago

I see. Thanks for reply.

dcparker commented 14 years ago

So is there a fix that should be applied? I'd like to have this fixed, and if you know how to work around it, can we get this into the gem code?

dcparker commented 14 years ago

(Thanks, by the way)

iwakura commented 14 years ago

Sorry, I have not solution for now.

justinperkins commented 14 years ago

Actually this is happening because the defaults are different in 1.9, at least that's what I think at a quick glance. I will commit a patch for this. It is backwards compatible.

FWIW, net/imap is part of ruby core

dcparker commented 14 years ago

Fixed, and a new gem (v0.0.5) has been pushed to gemcutter.org.