小编Sha*_*wel的帖子

如何设置 ActionMailer 使用 TLS 连接所需的 SSL 协议?

我在尝试将校园的 SMTP 服务器与 Rails 5.x 应用程序一起使用时遇到问题。我收到以下错误: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: 未知协议。

这是我的配置:

config.action_mailer.smtp_settings = {
    address:              'address.domain',
    port:                 587,
    user_name:            'UNAME',
    password:             'PWD',
    authentication:       :login,
    tls:                  true,
    enable_starttls_auto: true
  }
Run Code Online (Sandbox Code Playgroud)

为了确保我使用最新的 openssl 版本,我还在 Gemfile 中要求了“openssl”,并且它安装了 openssl-2.1.2。

关于后续步骤的建议?

ssl ruby-on-rails actionmailer

5
推荐指数
1
解决办法
3611
查看次数

标签 统计

actionmailer ×1

ruby-on-rails ×1

ssl ×1