我有一个 Postfix / Dovecot / MySQL 电子邮件服务器,配置了用户密码登录。除了 Dovecot 不向客户端发送链 CA 文件之外,一切正常。我有
ssl_cert = </etc/apache2/ssl/apache.crt
ssl_key = </etc/apache2/ssl/apache.key
ssl_ca = </etc/apache2/ssl/apache.pem
在我的 /etc/dovecot/conf.d/10-ssl.conf 中。但是,CA 文件未发送。
openssl s_client -connect server.com:143 -starttls imap
CONNECTED(00000003)
depth=0 CN = server.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 CN = server.com
verify error:num=21:unable to verify the first certificate
verify return:1
...
如果我添加ssl_verify_client_cert = yes
,一切都会正常工作。
openssl s_client -connect server.com:143 -starttls imap
CONNECTED(00000003)
depth=2 C = US, ST = Arizona, L = Scottsdale, O = "Starfield Technologies, Inc.", CN = Starfield Root Certificate Authority - G2
verify return:1
depth=1 C = US, ST = Arizona, L = Scottsdale, O = "Starfield Technologies, Inc.", OU = http://certs.starfieldtech.com/repository/, CN = Starfield Secure Certificate Authority - G2
verify return:1
depth=0 CN = server.com
verify return:1
但是我没有使用客户端证书授权。我是否误解了 Dovecot 配置,或者这是预期行为?我应该保持原样吗?
答案1
解决了我自己的问题。您需要将证书与链文件合并。
cat apache.crt apache.pem > dovecot.crt
然后你只需要
ssl_cert = </etc/apache2/ssl/dovecot.crt
ssl_key = </etc/apache2/ssl/apache.key