larch icon indicating copy to clipboard operation
larch copied to clipboard

gmail ssl

Open whity opened this issue 12 years ago • 1 comments

Hello,

I'm getting the following error when connecting to gmail: "OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: sslv3 alert handshake failure (cannot recover)"

any clue how to solve this?

whity avatar Feb 21 '13 18:02 whity

Hi,

I fixed this with the following changes:

  1. added a new option --ssl_version
  2. on imap.rb
def initialize
    ...
    ####
    @ssl_options = Hash.new()
    if (@options[:ssl_version])
       @ssl_options[:ssl_version] = @options[:ssl_version]
    end
    ####
end

def unsafe_connect()
    ...
    Thread.new do
      begin
        @conn = Net::IMAP.new(
                host, 
                {
                        :port => port,
                        :ssl  => @ssl_options
                },      
                ssl?, 
                ssl? && @options[:ssl_verify] ? @options[:ssl_certs] : nil, 
                @options[:ssl_verify]
        )
    ...

whity avatar Feb 21 '13 22:02 whity