大网数据广告活动
服务器运维问答

Postfix still complains that "certificate verification failed" even when "smtp_tls_security_level = fingerprint"

· 52CE 我爱测

I'm attempting to use Postfix (version 2.6.6 on RHEL6) to connect to and send mail via a mail relay on our internal network. I want to connect with STARTTLS on port 25 (port 465 is not available on this server). The mail relay us…

问题原文

原帖链接 · fronzee · CC BY-SA 3.0

I'm attempting to use Postfix (version 2.6.6 on RHEL6) to connect to and send mail via a mail relay on our internal network. I want to connect with STARTTLS on port 25 (port 465 is not available on this server). The mail relay uses a self-signed SSL/TLS certificate so I needed to skip certificate verification using a certificate authority. I discovered the smtp_tls_security_level = fingerprint which does not check the trust chain, expiration date, etc. Instead it verifies using the certificate fingerprint.

I figured this was the perfect solution, but when I attempt to send an email, I still get errors in /var/log/maillog that say postfix/smtp[15182]: certificate verification failed for xxxxxxxxxxxx[zz.zz.zz.zz]:25: untrusted issuer.

I thought the whole point of the fingerprint security level was to skip certificate verification. Am I misunderstanding the point of this option? Is there something else I need to configure?

Here are the relevant lines from main.cf:

relayhost = [xxx.xxx.xxx]
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl-passwords
smtp_sasl_security_options=
smtp_generic_maps = hash:/etc/postfix/generic
smtp_use_tls = yes
smtp_tls_security_level = fingerprint
smtp_tls_fingerprint_digest = sha1
# fingerprint changed for ServerFault. just an example.
smtp_tls_fingerprint_cert_match = c1:d3:54:12:00:r0:ef:fa:42:48:10:ff:ac:1e:75:13:dd:ad:af:3e
smtp_tls_note_starttls_offer = yes

Edit: added bold

已采纳解答

原帖链接 · fronzee · CC BY-SA 3.0

Gonna answer my own question here. I did not manage to get fingerprint verification working, but I did discover how to get TLS without certificate verification. From the manual:

Mandatory TLS encryption can be configured by setting "smtp_tls_security_level = encrypt". Even though TLS encryption is always used, mail delivery continues even if the server certificate is untrusted or bears the wrong name.

I had tried this at one point but must not have had all the right options enabled. But using the settings above, I simply changed smtp_tls_security_level to encrypt and it works fine.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-07-23)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。