title: How to fix 'OpenSSL::SSL::SSLError' error in Ruby?
body: <p>I use CloudFlare Flexible SSL certificate.</p>
  
  <p>When I try send user registration confirmation, I receive 500 error. In log:</p>
  
  <blockquote>
    <p>OpenSSL::SSL::SSLError (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol):</p>
  </blockquote>
  
  <p>My <b>production.rb</b>:</p>
  
  <pre><code>config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
  tls: true,
      address: 'smtp.yandex.ru',
      port: 587,
      domain: 'yandex.ru',
      authentication: 'plain',
      user_name: 'admin@site.ru',
      password: 'password',
  }
  </code></pre>
  
  <p>How can I fix this error?</p>