“hostname 'mail.domain.tld' 与服务器证书不匹配” :: 是否支持 SNI?以及如何从 Discourse 容器查询证书?

I’m getting some kind of a certificate error when accessing the pop3 mail server from another server on our domain. The resultant message is: Job exception: hostname "mail.domain.tld" does not match the server certificate, but does not give the actual hostname mismatch information within the backtrace.

First, SNI is required in this situation and a sysadmin has suggested that Discourse may not be configured properly to use SNI and thus the error message. The certs have tested out and seem to have no problems.

Second, just to make sure I’m on the same page with debug: How should access POP3 (or the cert request and comparison) from within the Discourse container so as to actually get this data that is being compared to indicated a certificate mismatch? I’d like to do a sanity check here to be sure I’m comparing proverbial apples to apples…

I did check in to see if SNI could be disabled on the sever and the reply was that it’s not possible. The sysadmin said:

Please note that there is no supported mechanism for disabling mail SNI, so you will need to work with the Discourse developers to support it. These pages may be of assistance to you in doing that:

ruby - OpenSSL::SSL::SSLContext SNI servername_cb Not Working - Stack Overflow
ruby - OpenSSL::X509::Certificate Showing Certificate for Wrong Domain - Stack Overflow

My recommendation would be to use Straightforward direct-delivery incoming mail rather than pop3.

I’m really glad you pointed that out, I’d not seen this option anywhere and wish I’d known about the this from the get-go. Might be a good idea to add this info to the installation instructions or perhaps even mention it within the app.yaml as something to consider when setting up the email section.

I did ask for some input there as well for some additional clarity given my scenario. Please feel free to chime in.

It’s actually linked in the top post of Set up Reply via Email Support:

:bell: Alternately, if you aren’t comfortable using GMail for this, you can set up your own incoming email service using Straightforward direct-delivery incoming mail

Your original post doesn’t specify which documentation you were following to go down the POP3 rabbit hole, but assuming you were looking at the official guide linked above it has been linked in there since March 28.

I’ve responded to your reply in the other topic to suggest how to structure addresses/domains when using this.

我也愿意积极参与,并恳请支持 SNI。Postfix 和 Dovecot 在过去一年中均已添加了对 SNI 的支持,包括我在内的许多用户也已完成了迁移。通常 Discourse 在这类问题上总是走在前列,因此看到路线图未将其列入,说实话我感到有些意外。

只是想确认一下,SNI 是否在未来的开发计划中?Safari 和 Outlook 都支持 SNI,而且已经支持了近五年。如果我能直接使用 SNI 而不是指向单一邮件服务器,这将大大简化我的邮件服务器配置。