Hostname does not match server certificate

Guys,

I’ve tried all you have previously suggested but definitely I cannot succeed with that. Log says that the hostname does not match the server certificate. Any bit of help?

Thanks for your time, it’s bit frustrating.

Cheers!

Fix the server certificate so it matches the hostname. Without knowing which certificate, and which hostname, and how all this came to be, it’s a bit hard to be more helpful than that.

5 个赞

Thanks Matt (@mpalmer)

The complete message from the log is that one:

Sent mail to info@blockchainers.cat (329.6ms)
Job exception: hostname "smtp.blockchainers.cat" does not match the server certificate

And the app.yml file contains as bellow:

## TODO: The domain name this Discourse instance will respond to
DISCOURSE_HOSTNAME: discourse.blockchainers.cat

## Uncomment if you want the container to be started with the same
## hostname (-h option) as specified above (default "$hostname-$config")
#DOCKER_USE_HOSTNAME: true

## TODO: List of comma delimited emails that will be made admin and developer
## on initial signup example 'user1@example.com,user2@example.com'
DISCOURSE_DEVELOPER_EMAILS: 'info@blockchainers.cat'

## TODO: The SMTP mail server used to validate new accounts and send notifications
DISCOURSE_SMTP_ADDRESS: smtp.blockchainers.cat
DISCOURSE_SMTP_PORT: 578
DISCOURSE_SMTP_USER_NAME: info@blockchainers.cat
DISCOURSE_SMTP_PASSWORD: password-here
#DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
#LETSENCRYPT_ACCOUNT_EMAIL: me@example.com

## The CDN address for this Discourse instance (configured to pull)
## see https://meta.discourse.org/t/14857 for details
#DISCOURSE_CDN_URL: //discourse-cdn.example.com

I’ve already tried with port 25, 578 and 587. Also modified SiteSetting.notification_email with rails command. No succeed.

Telnet seems to repond well:

root@BLOCKCHAINERS:/var/discourse# telnet smtp.blockchainers.cat 578
Trying 46.16.61.50...
Connected to smtp.blockchainers.cat.
Escape character is '^]'.
220 fnsib-smtp07.srv.cat ESMTP
^]

telnet> 

Appart from that, my domain nameserver (CDMON) says that my A register should pint to digitalocean virtual server IP, but my NS should be left empty. It’s a bit confusing to me since Droplet Networking section in digital ocean says I should edit both A and NS registers (please find screenshot attached). . Am I misunderstanding that?

So, I’m running out of ideas to sort it out. Do you have any clue on what is happening or if I’m doing some error with app.yml configuration? By now I can enter the domain and start with Discourse wizard, but no welcome email is entering to my mailbox.

Thanks for all.

Cheers.

That resolves to a single IP address for me (46.16.61.50) and the server there has a certificate for srv.cat and *.srv.cat, not for anything blockchainers. That’s why you are getting the error. On SMTP connection, the banner identifies the machine as fnsib-smtp07.srv.cat, but DNS lookups of that name don’t return that IP address (although it does return six others near by).

(BTW, I checked the cert with https://ssl-tools.net/mailservers in case other people want to test their servers.)

I think you need to get the *.srv.cat name for that mail server.

3 个赞

Thanks @elijah

How can solve that then? My domain nameserver provider says I should not change NS registars, just the A registar. Is that related with your suggestion?

What if I uncomment this line? Should that solve the problem?

## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate
#LETSENCRYPT_ACCOUNT_EMAIL: me@example.com

Cheers.

You should ask whoever you can what DNS name to use for the mail server so that it will agree with the name in the certificate. It’s not your DNS that is at fault, it is the DNS of the mail server.

1 个赞

geting same error … plz help what to do instaled on centos7 with plesk

我也遇到了同样的错误,请帮忙。

主服务器配置错误。这不是 Discourse 的问题。

请联系负责您邮件服务器的相关人员,寻求他们的帮助。

1 个赞

你好。这个问题依然存在……
SMTP 连接成功,但随后出现:

发送邮件失败。  
主机名 "protolife.com" 与服务器证书不匹配  

标准的 SSL 检查工具(例如 这个)报告称,主机 protolife.com 拥有证书,并且已正确列入其中。这是否与错误信息相矛盾?

如果能知道 hostname xxx does not match the server certificate 这条错误信息是在哪里生成的,将会很有帮助。是由 Discourse 生成的?还是由 SMTP 服务器生成并通过 discourse.doctor 传递过来的?

提前感谢……

1 个赞

设置

DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
5 个赞

非常感谢您的建议。在此期间,我排查并解决了一个反向 DNS 问题,现在一切正常了。

2 个赞

请问,我目前遇到了同样的问题。您是如何解决这个问题的?

我调试了一个反向 DNS 问题,现在一切都正常了。

您采取了哪些步骤?