Hostname does not match server certificate



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.


Troubleshooting email on a new Discourse install
(Matt Palmer) #2

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.


Thanks Matt (@mpalmer)

The complete message from the log is that one:

Sent mail to (329.6ms)
Job exception: hostname "" does not match the server certificate

And the app.yml file contains as bellow:

## TODO: The domain name this Discourse instance will respond to

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

## TODO: List of comma delimited emails that will be made admin and developer
## on initial signup example ','

## TODO: The SMTP mail server used to validate new accounts and send notifications
#DISCOURSE_SMTP_ENABLE_START_TLS: true           # (optional, default true)

## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate

## The CDN address for this Discourse instance (configured to pull)
## see for details

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 578
Connected to
Escape character is '^]'.


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.


(Eli the Bearded) #5

That resolves to a single IP address for me ( and the server there has a certificate for and *, not for anything blockchainers. That’s why you are getting the error. On SMTP connection, the banner identifies the machine as, 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 Mailserver encryption test (STARTTLS, TLS and PFS) · SSL-Tools in case other people want to test their servers.)

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


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


(Eli the Bearded) #7

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.