Меню

Redmine во время отправки письма произошла ошибка hostname does not match the server certificate

Forums » Help »

Hi all,

In the Administration -> Settings page, when I try send send a test email. I’ve the following error message :
hostname was not match with the server certificate

This my config/configuration.yml

production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: "localhost" 
      port: 25
      enable_starttls_auto: false
      openssl_verify_mode: 'none'

I’ve also tried the following parameters but doesn’t solve my issue.

tls: false
domain: "localhost.localdomain" 
authentication: :none

When I do any modification on the redmine config files, I restart redmine by typing:
service apache2 restart
(redmine is running by apache2 and mod_passenger on a Debian Squeeze up to date)

The mail server is run by postfix on the same machine, but it doesn’t receive anything (when reading the mail logs)

Environment:
  Redmine version                          2.1.5.stable
  Ruby version                             1.8.7 (x86_64-linux)
  Rails version                            3.2.8
  Environment                              production
  Database adapter                         MySQL
Redmine plugins:
  no plugin installed

Thanks a lot for your help


RE: hostname was not match with the server certificate

Added by Alain JUPIN almost 10 years ago

Hello

I’ve done this since my first post.
This is my config/environnement.rb

# Load the rails application
require File.expand_path('../application', __FILE__)

# Turn off auto TLS for e-mail
ActionMailer::Base.smtp_settings[:openssl_verify_mode] = false
ActionMailer::Base.smtp_settings[:enable_starttls_auto] = false

# Make sure there's no plugin in vendor/plugin before starting
vendor_plugins_dir = File.join(Rails.root, "vendor", "plugins")
if Dir.glob(File.join(vendor_plugins_dir, "*")).any?
  $stderr.puts "Plugins in vendor/plugins (#{vendor_plugins_dir}) are no longer allowed. " +
    "Please, put your Redmine plugins in the `plugins` directory at the root of your " +
    "Redmine directory (#{File.join(Rails.root, "plugins")})" 
  exit 1
end

# Initialize the rails application
RedmineApp::Application.initialize!

This doesn’t solve my issue 🙁 ???

Thanks for your message.

Redmine-LogoПараметры для отсылки почтовых уведомлений в Redmine настраиваются в файле configuration.yml. В примере, который приводится разработчиками в файле configuration.yml.example можно увидеть базовые схемы настройки (с шифрованием и без, а также через sendmail). В данном случае я привожу пример рабочей настройки для соединения по SSL.

production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      tls: true
      enable_starttls_auto: true
      address: smtp.your-server.com
      port: 465
      domain: your-server.com
      authentication: :login
      user_name: "your-username@your-server.com"
      password: "your-password"
      openssl_verify_mode: "none"

Следует обратить внимание на пареметр openssl_verify_mode: «none». Он нужен для того, чтобы Redmine не проверял подлинность сертификата почтового сервера, а просто использовал тот, который есть, для шифрования. В некоторых случаях сертифиакат установлен не совсем корректно, что мешает пройти проверку подлинности и письма из Redmine не отправляются, выводя ошибку

hostname was not match with the server certificate

Пугаться параметра tls: true не стоит, так как для Redmine TLS и SSL — синонимы.



интернет

Chapter 1. Шаг 1.

Открываем файл, если у вас Bitnami Redmine: /opt/bitnami/apps/redmine/htdocs/config/configuration.yml
Или
ищем в своей папке файл: /config/configuration.yml

Chapter 2. Шаг 2.

Находим:

# specific configuration options for production environment

# that overrides the default ones

production:

В самом конце добавляем, за место production

production:

delivery_method: :async_smtp

smtp_settings:

  address: адрес_почтового_сервера (обычно mail.site.ru)

  port: 465

  ssl: true

  enable_starttls_auto: true

  domain: ваш_домен_почты

  authentication: :login

  user_name: «ваша_почта»

  password: «ваш_пароль»

Пример:

production:

delivery_method: :async_smtp

smtp_settings:

  address: mail.community.galaxydata.ru

  port: 465

  ssl: true

  enable_starttls_auto: true

  domain: community.galaxydata.ru

  authentication: :login

  user_name: «noc@community.galaxydata.ru»

  password: «password»

Шаг 3.

Обязательно перезагрузите процесс redmine
Если у вас redmine установлен через bitnami

/opt/bitnami/ctlscript.sh restart

или
Для Debian, Ubuntu

/etc/init.d/apache2 restart

Для Centos, Fedora, RedHat

/etc/init.d/httpd restart

0.1. Частые ошибки возникающие при настройке:

An error occurred while sending mail (SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol)

An error occurred while sending mail (hostname was not match with the server certificate)

Connection refused — connect(2))

Redmine Error Sending Email


Description

I encountered a problem with redmine where it would not send email. After checking the production.log I found the following error:

Email delivery error: hostname does not match the server certificate

It turns out I needed to add the following to the configuration.yml:

# default configuration options for all environments
default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      address: smtp.example.com
      port: 587
      domain: example.com
      authentication: :login
      user_name: "root@example.com" 
      password: "SuperSecretPassword" 
      openssl_verify_mode: 'none'

The last line openssl_verify_mode: ‘none’ is what relaxed the certificate checking.

  • History
  • Property changes
  • Spent time
  • Status changed from In Progress to Closed
  • Description updated (diff)
  • Description updated (diff)
  • Project changed from 24 to Website Hosting

Also available in: Atom
PDF

I have my Rails application configured to use ‘none’ for openssl verification, but I’m still running into the error message:

OpenSSL::SSL::SSLError (hostname does not match the server certificate)

I’m using the following configuration:

config/intializers/setup_mail.rb

if Rails.env != 'test'
  email_settings = YAML::load(File.open("#{Rails.root.to_s}/config/email.yml"))
  ActionMailer::Base.smtp_settings = email_settings[Rails.env] unless email_settings[Rails.env].nil?
end

config/email.yml

production:
  address: smtp.mts.net
  port: 25
  authentication: plain
  user_name: username
  password: secret
  enable_starttls_auto: true
  openssl_verify_mode: none

config/environments/production.rb

  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default_url_options = { :host => 'example.com' }

ActionMailer seems to completely disregard openssl_verify_mode: none

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Redmi мультиварка ошибка е4
  • Redmi power bank 10000mah ошибка зарядки