我使用OpenSSL创build一个私钥和自签名的公共证书。 然后,我创build了包含私钥和公共证书(mail.example.com.pem)的证书颁发机构文件。 在局域网中的客户端计算机上,我使用OpenSSL连接到端口587(SMTP)上的Postfix,并告诉OpenSSL使用证书颁发机构文件(mail.example.com.pem)。
openssl s_client -connect mail.example.com:587 -starttls smtp -CAfile /etc/pki/tls/private/mail.example.com.pem
这产生了相当多的输出。 包含在输出中的是来自证书颁发机构文件的公共证书。
所有的TLS,证书和其他安全信息后,我有一个闪烁的光标,所以我试图对你说Postfix。
EHLO mail.example.com
这个命令产生“没有客户端证书”。
这很奇怪,因为我可以从字面上看到前一个输出中的公共证书。 我有一种感觉,我在这里错过了一些概念。 例如,我是否需要告诉客户发送或使用公共证书? Postfix服务器上的公共证书是否与客户端证书不同?
目标:我的总体目标是configurationPostfix来encryption邮件,而不是发送没有encryption的邮件。
这是postconf -n命令的输出:
data_directory = /var/lib/postfix home_mailbox = Maildir/ inet_interfaces = all inet_protocols = all mail_owner = postfix mailbox_command = mydestination = example.com, localhost.example.com, localhost mynetworks_style = host queue_directory = /var/spool/postfix smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination smtpd_sasl_auth_enable = no smtpd_sasl_path = private/auth smtpd_tls_CAfile = /etc/pki/tls/mail.example.com.pem smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/pki/tls/mail.example.com.crt smtpd_tls_key_file = /etc/pki/tls/mail.example.com.key smtpd_tls_loglevel = 3 smtpd_tls_req_ccert = yes smtpd_tls_security_level = encrypt smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_tls_cache smtpd_tls_session_cache_timeout = 3600s tls_random_exchange_name = /var/lib/postfix/prng_exch tls_random_source = dev:/dev/urandom
您已经在Postfixconfiguration中设置了smtpd_tls_req_ccert 。
这个指令要求所有的客户端都有一个由你发给特定客户端的客户端证书。 只有来自预先批准的主机才允许到服务器的SMTP连接。
这显然不是你想要的。 您正尝试从整个Internet接收邮件,并且您不可能向全球的每个SMTP服务器颁发客户端证书。
首先,删除该指令,然后重试。 您可能还有其他问题,但这是造成眼前问题的原因。