【问题标题】:ssl_connect returned=1 errno=0 state=sslv2/v3 read server hello a unknown protocol rails 4ssl_connect 返回=1 errno=0 state=sslv2/v3 读取服务器你好未知协议 rails 4
【发布时间】:2015-07-25 22:35:03
【问题描述】:

我尝试修复它,但无济于事。请帮忙。

config.action_mailer.raise_delivery_errors = true
  # config.assets.debug = true
  # config.action_mailer.perform_deliveries = true
    config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
  address:              'smtp.gmail.com',
  port:                 '587',
  domain:               'gmail.com',
  tsl: true,
  user_name:            'email@gmail.com',
  password:             'password',
  authentication:       :plain,
  ssl: true,
  enable_starttls_auto: true ,
  openssl_verify_mode: 'none'
  }

错误:返回的 SSL_connect=1 errno=0 state=SSLv2/v3 读取服务器 hello A:未知协议

当我在网上搜索时,他们只是添加了一行“enable_starttls_auto: true, openssl_verify_mode: 'none'”会以错误结尾,但它仍然没有解决我的问题。

【问题讨论】:

  • 你得到答案了吗?

标签: ruby-on-rails


【解决方案1】:

请试试这个:

 ActionMailer::Base.smtp_settings = {
  :address        => 'smtp.sendgrid.net',
  :port           => '587',
  :authentication => :plain,
  :user_name      => ENV['SENDGRID_USERNAME'],
  :password       => ENV['SENDGRID_PASSWORD'],
  :domain         => 'heroku.com',
  :enable_starttls_auto => true

 }

【讨论】:

  • 如果我这样做,它会显示错误:“Net::ReadTimeout”
  • 这行得通吗?我也收到一个错误。 SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol
猜你喜欢
  • 2015-06-13
  • 2011-03-31
  • 2016-12-02
  • 1970-01-01
  • 2013-06-26
  • 1970-01-01
  • 2019-04-03
  • 2011-05-30
相关资源
最近更新 更多