gmail ssl
whity opened this issue · 1 comments
whity commented
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 commented
Hi,
I fixed this with the following changes:
- added a new option --ssl_version
- 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]
)
...