Is my Hosting company intercepting my TLS cert?

Below is the debug log. It appears that my hosting company is intercepting the TLS cert and replacing it with their own causing TLS authentication to fail. Is this the case or is it possible there is some sort of misconfiguraiton. I’m using the same config.php that I used just three weeks ago when it was working. I’m using phpList 3.3.1. I tried with both the standard PHPMailer and 5.2.24 from their github page and both give the same problem.

define('PHPMAILERHOST', 'smtp.office365.com:587');

# in the above you can specify multiple SMTP servers like this:
# 'server1:port1;server2:port2;server3:port3' eg
#define('PHPMAILERHOST','smtp1.mydomain.com:25;smtp2.mydomain.com:2500;smtp3.phplist.com:5123');

# if you want to use smtp authentication when sending the email uncomment the following
# two lines and set the username and password to be the correct ones
$phpmailer_smtpuser = '[REDACTED]';
$phpmailer_smtppassword = '[REDACTED]';

## you can set this to send out via a different SMTP port
define('PHPMAILERPORT',587);

## test vs blast
# you can send test messages via a different SMTP host than the actual campaign queue
# if not set, these default to the above PHPMAILERHOST and PHPMAILERPORT
# define('PHPMAILERTESTHOST','testsmtp.mydomain.com');
# define('PHPMAILERBLASTHOST','livesmtp.mydomain.com');
# define('PHPMAILERBLASTPORT',25);

# to use SSL/TLS when sending set this value
# it can either be "ssl" or "tls", nothing else
define("PHPMAILER_SECURE",'tls');

## SMTP debugging
# Enable debugging output by phpmailer when sending test emails
# See https://phpmailer.github.io/PHPMailer/classes/PHPMailer.html#property_SMTPDebug
define('PHPMAILER_SMTP_DEBUG', 4);

## Smtp Timeout
## If you use SMTP for sending, you can set the timeout of the SMTP connection
## defaults to 5 seconds
define('SMTP_TIMEOUT',5);

Here is the debug output

2017-08-23 20:06:47 Connection: opening to smtp.office365.com:587, timeout=5, options=array ()
2017-08-23 20:06:47 Connection: opened
2017-08-23 20:06:47 SMTP → get_lines(): $data is “”
2017-08-23 20:06:47 SMTP → get_lines(): $str is "220-ams101.arvixeshared.com ESMTP Exim 4.87 #1 Wed, 23 Aug 2017 16:06:47 -0400 "
2017-08-23 20:06:47 SMTP → get_lines(): $data is "220-ams101.arvixeshared.com ESMTP Exim 4.87 #1 Wed, 23 Aug 2017 16:06:47 -0400 "
2017-08-23 20:06:47 SMTP → get_lines(): $str is "220-We do not authorize the use of this system to transport unsolicited, "
2017-08-23 20:06:47 SMTP → get_lines(): $data is "220-ams101.arvixeshared.com ESMTP Exim 4.87 #1 Wed, 23 Aug 2017 16:06:47 -0400 220-We do not authorize the use of this system to transport unsolicited, "
2017-08-23 20:06:47 SMTP → get_lines(): $str is “220 and/or bulk e-mail.”
2017-08-23 20:06:47 SERVER → CLIENT: 220-ams101.arvixeshared.com ESMTP Exim 4.87 #1 Wed, 23 Aug 2017 16:06:47 -0400 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
2017-08-23 20:06:47 CLIENT → SERVER: EHLO [REDACTED]
2017-08-23 20:06:47 SMTP → get_lines(): $data is “”
2017-08-23 20:06:47 SMTP → get_lines(): $str is “250-ams101.arvixeshared.com Hello [REDACTED] [5.10.94.9]”
2017-08-23 20:06:47 SMTP → get_lines(): $data is “250-ams101.arvixeshared.com Hello [REDACTED] [5.10.94.9]”
2017-08-23 20:06:47 SMTP → get_lines(): $str is “250-SIZE 52428800”
2017-08-23 20:06:47 SMTP → get_lines(): $data is “250-ams101.arvixeshared.com Hello [REDACTED] [5.10.94.9]250-SIZE 52428800”
2017-08-23 20:06:47 SMTP → get_lines(): $str is “250-8BITMIME”
2017-08-23 20:06:47 SMTP → get_lines(): $data is “250-ams101.arvixeshared.com Hello [REDACTED] [5.10.94.9]250-SIZE 52428800250-8BITMIME”
2017-08-23 20:06:47 SMTP → get_lines(): $str is “250-PIPELINING”
2017-08-23 20:06:47 SMTP → get_lines(): $data is “250-ams101.arvixeshared.com Hello [REDACTED] [5.10.94.9]250-SIZE 52428800250-8BITMIME250-PIPELINING”
2017-08-23 20:06:47 SMTP → get_lines(): $str is “250-AUTH PLAIN LOGIN”
2017-08-23 20:06:47 SMTP → get_lines(): $data is “250-ams101.arvixeshared.com Hello [REDACTED] [5.10.94.9]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN”
2017-08-23 20:06:47 SMTP → get_lines(): $str is “250-STARTTLS”
2017-08-23 20:06:47 SMTP → get_lines(): $data is “250-ams101.arvixeshared.com Hello [REDACTED] [5.10.94.9]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS”
2017-08-23 20:06:47 SMTP → get_lines(): $str is “250 HELP”
2017-08-23 20:06:47 SERVER → CLIENT: 250-ams101.arvixeshared.com Hello [REDACTED] [5.10.94.9]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
2017-08-23 20:06:47 CLIENT → SERVER: STARTTLS
2017-08-23 20:06:47 SMTP → get_lines(): $data is “”
2017-08-23 20:06:47 SMTP → get_lines(): $str is “220 TLS go ahead”
2017-08-23 20:06:47 SERVER → CLIENT: 220 TLS go ahead
2017-08-23 20:06:47 Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=*.arvixeshared.com' did not match expected CN=smtp.office365.com’ [[REDACTED]/admin/PHPMailer/class.smtp.php line 375]
SMTP Error: Could not connect to SMTP host.
2017-08-23 20:06:47 CLIENT → SERVER: QUIT
2017-08-23 20:06:47 SMTP → get_lines(): $data is “”
2017-08-23 20:06:47 SMTP → get_lines(): $str is “221 ams101.arvixeshared.com closing connection”
2017-08-23 20:06:47 SERVER → CLIENT: 221 ams101.arvixeshared.com closing connection
2017-08-23 20:06:47 Connection: closed
SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub

@objecttothis Possibly your hosting company does not allow an external smtp server to be used in this way.What is the background, did this used to work but now does not, or is it a new installation?

It worked on the exact same config.php and install on August 1st just three weeks ago.

@objecttothis Ah sorry, you had said that in your first post. If you haven’t changed anything then I suggest that you raise the problem with the hosting company.
There is a config file setting that will disable certificate checking, which might have an effect. See https://resources.phplist.com/system/config/phpmailer_smtpoptions

Turns out that Arvixe has a general policy of blocking the use of external SMTP servers. Prior to three weeks ago, it worked fine. I contacted them and they provisionally white-listed my account provided I don’t violate CAN-SPAM laws. It works now.