Using a Microsoft email server email, NextCloud reports SSL issues when connecting to this server

The Basics

  • Nextcloud Server version (e.g., 29.x.x):
    • 31
  • Operating system and version (e.g., Ubuntu 24.04):
    • centos10 docker
  • Web server and version (e.g, Apache 2.4.25):
    • docker image version
  • Reverse proxy and version _(e.g. nginx 1.27.2)
    • NOT
  • PHP version (e.g, 8.3):
    • replace me
  • Is this the first time you’ve seen this error? (Yes / No):
    • replace me
  • When did this problem seem to first start?
    • today
  • Installation method (e.g. AlO, NCP, Bare Metal/Archive, etc.)
    • cmd
  • Are you using CloudfIare, mod_security, or similar? (Yes / No)
    • NO

TransportException
Connection could not be established with host “ssl://mail…com:25”: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:0A00010B:SSL routines::wrong version number
Sending mail to "Array ( [ITCenter@.com] => admin ) " with subject “电子邮箱设置测试” failed

hello,i find this debug info .

I passed through
cp your_certificate.crt /usr/local/share/ca-certificates/
update-ca-certificates

Include both the root certificate and the certificate for the domain name itself
However, the effect remains the same even after restarting

To disable peer verification or to use self signed certificates, add the following to your config/config.php:

"mail_smtpstreamoptions" => array(
    'ssl' => array(
        'allow_self_signed' => true,
        'verify_peer' => false,
        'verify_peer_name' => false
    )
),
1 Like

After setting these settings, it still doesn’t work. I found that the system prompted that the SSL version is incorrect. Is this because NextCloud used an SSL version that is not compatible with the email server when sending emails


172 is the NextCloud server, and 117 is the mail server.