Cannot configure SMTP server in Joomla:
PLESK_ERROR: SMTP Error: Could not connect to SMTP host.
The following error can be found in domain error_log:
# mod_fcgid: stderr: Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=`example.com' did not match expected CN=`somedomain.tld'
Starting from PHP 5.6 stream wrapper now verify peer certificates and host names by default when using SSL/TLS. What does it mean:
- Connection will fail in case you use self-signed certificate
- Or in case your certificate for mail is not the same as your domain name connection will fail too.
There are two options to solve this:
1. Secure mail using Let's Encrypt and instructions from KB #115000179934 and use everywhere domain name you used to secure mail in most cases hosting providers use hostname of the server fro that.
2. In case you would like each domain owner to be able to specify their domain name, create multi-domain certificate and install it manually using #213924425 , in that case you would be able to connect using any domain name from the certificate.