title: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
body: <p>I have a ruby client that connects to an exchange server using IMAP &amp; 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:</p>
  
  <pre><code> SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
  </code></pre>
  
  <p>Does anyone know what this error means? (I tried googling)</p>
  
  <p>I suspect there is an issue with the new cert causing this, but I dont know how to troubleshoot it. </p>
  
  <p>Also I know you can disable certificate verification when using NET:HTTP by doing:</p>
  
  <pre><code> http.verify_mode = OpenSSL::SSL::VERIFY_NONE if http.use_ssl?
  </code></pre>
  
  <p>but I cant figure out how to do this using NET:IMAP. I want to disable this to see if this is the problem. </p>
  
  <p>As for code im using:
  Im using this(or very close to this) <a href="http://github.com/look/fetcher/blob/master/lib/fetcher/imap.rb" rel="noreferrer">http://github.com/look/fetcher/blob/master/lib/fetcher/imap.rb</a></p>
  
  <p>I tried changing to :
       @connection = Net::IMAP.new(@server, @port, @ssl, nil, false)</p>
  
  <p>Here is the stacktrace</p>
  
  <pre><code> 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'
  </code></pre>