Hello,
Unfortunately, we are facing the same issue with our osTicket installation (ubuntu VM):

We cannot connect to the on-premises exchange mail server 2019 (contains trusted, third-party signed SSL certificate) through osTicket:

because we get the exact same error:

which changes when I add the tls:// prefix to the mail server name:

I could not find anything related to the issue in the local log files (web server or php) and I have petitioned and waiting for the mail server logs.
Not sure how to proceed regarding the SSL certificate, any help is welcome.