本文介绍了SSL_connect SYSCALL returned = 5 errno = 0 state = SSLv2 / v3 read server hello A的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ruby客户端,使用IMAP& SSL。我使用Ruby Net :: IMAP库(其中使用openssl)来连接。它已经工作好几个月了。交换服务器管理员从godaddy安装新的证书现在我得到这个错误:

  SSL_connect SYSCALL返回= 5 errno = 0状态= SSLv2 / v3读取服务器hello A 

有人知道这个错误是什么意思? (我试过谷歌搜索)



我怀疑有新的证书导致这个问题,但我不知道如何解决它。



此外,我知道您可以在使用NET:HTTP时禁用证书验证:

  http.verify_mode = OpenSSL :: SSL :: VERIFY_NONE如果http.use_ssl? 

但我不知道如何使用NET:IMAP。我想禁用这个,看看这是否是问题。



至于代码im使用:
Im使用此(或非常接近此) p>

我尝试更改为:
@connection = Net :: IMAP.new(@server,@port,@ssl,nil,false)



这里是stacktrace

 检查电子邮件on:Tue Aug 17 20:48:01 +0000 2010 
耙子中止!
SSL_connect SYSCALL returned = 5 errno = 0 state = SSLv2 / v3 read server hello A
/usr/lib/ruby/1.8/net/imap.rb:904:in`connect'
/usr/lib/ruby/1.8/net/imap.rb:904:in'initialize'
/u/apps/aras/releases/20100728212439/vendor/plugins/fetcher/lib/fetcher/imap.rb: 34:in`new'
/u/apps/aras/releases/20100728212439/vendor/plugins/fetcher/lib/fetcher/imap.rb:34:in`establish_connection'
/ usr / lib / ruby / gems / 1.8 / gems / system_timer-1.0 / lib / system_timer.rb:28:in'timeout_after'
/ u / apps / aras / releases / 20100728212439 / vendor / plugins / fetcher / lib / fetcher / imap .rb:33:in`establish_connection'
/u/apps/aras/releases/20100728212439/vendor/plugins/fetcher/lib/fetcher/base.rb:31:in`fetch'


解决方案

原来这个问题的根本原因是ms交换错误配置。我很想知道更多关于ssl错误和如何troublshoot他们,但我只是没有得到这方面的很多信息。



我试图只是troublshoot这使用open ssl,fyi,你可以这样做:
OpenSSL> s_client -connect myserver:993



当它被破坏时,我收到这个错误:
CONNECTED (00000003)
26831:错误:140790E5:SSL例程:SSL23_WRITE:ssl握手
失败:s23_lib.c:188:



我得到了一个证书和握手消息等。



这是我的交换管理员说,他做了:我只是去了IMAP协议,进入访问标签,然后证书按钮,从那里我选择了替换证书并选择新的证书。


I have a ruby client that connects to an exchange server using IMAP & SSL. I use the Ruby Net::IMAP library (which uses openssl under the covers) to connect. Its been working fine for months. The exchange server admin installed new cert from godaddy and now I get this error:

 SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A

Does anyone know what this error means? (I tried googling)

I suspect there is an issue with the new cert causing this, but I dont know how to troubleshoot it.

Also I know you can disable certificate verification when using NET:HTTP by doing:

 http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl?

but I cant figure out how to do this using NET:IMAP. I want to disable this to see if this is the problem.

As for code im using:Im using this(or very close to this) http://github.com/look/fetcher/blob/master/lib/fetcher/imap.rb

I tried changing to : @connection = Net::IMAP.new(@server, @port, @ssl, nil, false)

Here is the stacktrace

 checking emails on: Tue Aug 17 20:48:01 +0000 2010
 rake aborted!
 SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
 /usr/lib/ruby/1.8/net/imap.rb:904:in `connect'
 /usr/lib/ruby/1.8/net/imap.rb:904:in `initialize'
 /u/apps/aras/releases/20100728212439/vendor/plugins/fetcher/lib/fetcher/imap.rb:34:in `new'
 /u/apps/aras/releases/20100728212439/vendor/plugins/fetcher/lib/fetcher/imap.rb:34:in `establish_connection'
 /usr/lib/ruby/gems/1.8/gems/system_timer-1.0/lib/system_timer.rb:28:in `timeout_after'
 /u/apps/aras/releases/20100728212439/vendor/plugins/fetcher/lib/fetcher/imap.rb:33:in `establish_connection'
 /u/apps/aras/releases/20100728212439/vendor/plugins/fetcher/lib/fetcher/base.rb:31:in `fetch'
解决方案

Well it turns out the root cause on this one was ms exchange was misconfigured. I would love to have learned more about ssl errors and how to troublshoot them, but I just didnt get much info on this.

I did try to just troublshoot this using open ssl, fyi, you can do:OpenSSL> s_client -connect myserver:993

When it was broken, I received this error:CONNECTED(00000003)26831:error:140790E5:SSL routines:SSL23_WRITE:ssl handshakefailure:s23_lib.c:188:

Once we fixed I got a cert and handshake message etc.

Here is what my exchange admin said he did: "I just went to the IMAP protocol and went to the access tab. Then the certificates button. From there I chose to replace the cert and chose the new cert."

这篇关于SSL_connect SYSCALL returned = 5 errno = 0 state = SSLv2 / v3 read server hello A的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 12:59