I'm setting-up Redmine to poll e-mails from gmail via IMAP. An attempt to run the appropriate Ruby task causes the following error:
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
The error occurs when Ruby attempts to connect imap.gmail.com
via OpenSSL, in the following code line:
imap = Net::IMAP.new(host, port, ssl)
When I try to connect the above host from OpenSSL command line, it gets connected successfully.
I understand that Ruby doesn't find some certificates and I saw various solution proposals, but unfortunately I still can't figure out how to sort out this issue (I do not use rvm).
I tried to disable the verification by setting OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
, but got "dynamic constant assignment" error.
My environment:
Linux debianvm 3.2.0-4-amd64 #1 SMP Debian 3.2.41-2+deb7u2 x86_64 GNU/Linux
root@debianvm:~# ruby --version
ruby 1.9.3p429 (2013-05-15 revision 40747) [x86_64-linux]
root@debianvm:~# rails --version
Rails 3.2.13