Easy Redmine SMTP配置错误:发送邮件时发生错误(SSL_connect返回= 1 errno = 0状态=错误:证书验证失败)

时间:2018-07-29 12:46:14

标签: ruby email smtp certificate redmine

我有以下smtp配置(/redmine_path/config/configuration.yml)

default:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: mail.example.com
      port: 465
      authentication: :plain
      domain: mail.example.com
      user_name: "redmine@example.com"
      password: "xxxxxxxx"
      tls: true
      enable_starttls_auto: false
      openssl_verify_mode: 'peer'

您希望这是TLS / SMTP邮件服务器配置的正确配置。

但是当您尝试发送测试电子邮件时。您收到以下错误: 发送邮件时发生错误(SSL_connect返回= 1 errno = 0状态=错误:证书验证失败)

enter image description here

1 个答案:

答案 0 :(得分:0)

正确的配置需要其他参数(在Debian上测试):

  ca_file: "/etc/ssl/certs/ca-certificates.crt"

  ca_path: "/etc/ssl/certs/"

更改之后,Redmine会正确找到CA根证书。

完全正常的配置:

default:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: mail.example.com
      port: 465
      authentication: :plain
      domain: mail.example.com
      user_name: "redmine@example.com"
      password: "xxxxxxxx"
      tls: true
      enable_starttls_auto: false
      openssl_verify_mode: 'peer'
      ca_file: "/etc/ssl/certs/ca-certificates.crt"

还要确保您已更新ca证书:

将“ package-manager”交换为yum,apt-get或zypper

<package-manager> install ca-certificates

我想知道有多少人放弃了,只是将openssl_verify_mode设置为“ none”。恐怕无法想到中间人攻击。

有关Ruby ActionMailer :: Base配置的详细信息ActionMailer SMTP "certificate verify failed"