I'm trying to set up postfix with TLS.
I've refreshed it by doing the following which removes the defaults so that tls enable-server update the main.cf file and generates certificates:
sudo postconf -X `postconf -nH | egrep '^smtpd(_|_enforce_|_use_)tls'`
sudo postfix tls enable-server
sudo postfix reload
Many instructions I've followed seem to indicate this is all that's required to enable TLS.
When I run the following...
openssl s_client -connect mailhost:25 -starttls smtp
I get the error:
Verification error: self signed certificate
This produces the error from my application:
stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
If I understand it, the enable-server command will generate a self-signed certificate for me and other sources tell me that's what's required.
Is there something I'm misunderstanding about self-signing and postfix? Why am I getting a validation error?