Title: Warning: stream_socket_enable_crypto(): Peer certificate CN=`uk.mthservers.com&#8217;
Last modified: February 1, 2018

---

# Warning: stream_socket_enable_crypto(): Peer certificate CN=`uk.mthservers.com’

 *  Resolved [chazg](https://wordpress.org/support/users/chazg/)
 * (@chazg)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/535-incorrect-authentication-data/)
 * The [enquiries@guardiansupport.co.uk](https://wordpress.org/support/topic/535-incorrect-authentication-data/enquiries@guardiansupport.co.uk?output_format=md)
   inbox is setup using Office365.
    When I fill out any of the contact forms on 
   the website and hit Submit, they do not send. The WP Mail SMTP settings are correct.
   I am using: From Email: [enquiries@guardiansupport.co.uk](https://wordpress.org/support/topic/535-incorrect-authentication-data/enquiries@guardiansupport.co.uk?output_format=md)
   SMPT Host: smtp.office365.com SMTP Port: 587 Encryption: TLS Authentication: 
   On SMPT Username: [enquiries@guardiansupport.co.uk](https://wordpress.org/support/topic/535-incorrect-authentication-data/enquiries@guardiansupport.co.uk?output_format=md)
   SMPT Password: (what ever the password is)
 * When I click on the Email Test tab and send a test email, I get the following
   error message:
 * There was a problem while sending a test email. Related debugging output is shown
   below:
 * Versions:
    WordPress: 4.9.2 WordPress MS: No PHP: 5.6.33 WP Mail SMTP: 1.2.2
 * Params:
    Mailer: smtp Constants: No ErrorInfo: SMTP connect() failed. [https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting)
   Host: smtp.office365.com Port: 587 SMTPSecure: tls SMTPAutoTLS: bool(true) SMTPAuth:
   bool(true)
 * Server:
    OpenSSL: Yes Apache.mod_security: No SMTP Debug: 2018-02-01 10:20:05
   Connection: opening to smtp.office365.com:587, timeout=300, options=array ( )
   2018-02-01 10:20:05 Connection: opened 2018-02-01 10:20:05 SERVER -> CLIENT: 
   220-uk.mthservers.com ESMTP Exim 4.89_1 #1 Thu, 01 Feb 2018 10:20:05 +0000 220-
   We do not authorize the use of this system to transport unsolicited, 220 and/
   or bulk e-mail. 2018-02-01 10:20:05 CLIENT -> SERVER: EHLO [http://www.guardiansupport.co.uk](http://www.guardiansupport.co.uk)
   2018-02-01 10:20:05 SERVER -> CLIENT: 250-uk.mthservers.com Hello [http://www.guardiansupport.co.uk](http://www.guardiansupport.co.uk)[
   5.101.138.188] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN
   250-STARTTLS 250 HELP 2018-02-01 10:20:05 CLIENT -> SERVER: STARTTLS 2018-02-
   01 10:20:05 SERVER -> CLIENT: 220 TLS go ahead
 * Warning: stream_socket_enable_crypto(): Peer certificate CN=`uk.mthservers.com'
   did not match expected CN=`smtp.office365.com’ in /home/guardian/public_html/
   wp-includes/class-smtp.php on line 369
 * 2018-02-01 10:20:05 SMTP Error: Could not connect to SMTP host.
    2018-02-01 10:
   20:05 CLIENT -> SERVER: QUIT 2018-02-01 10:20:05 SERVER -> CLIENT: 221 uk.mthservers.
   com closing connection 2018-02-01 10:20:05 Connection: closed 2018-02-01 10:20:
   05 SMTP connect() failed. [https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting)
 * Can someone please advise me with regards to what to do, thanks.
 * Chaz
    -  This topic was modified 8 years, 4 months ago by [chazg](https://wordpress.org/support/users/chazg/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2F535-incorrect-authentication-data%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Slava Abakumov](https://wordpress.org/support/users/slaffik/)
 * (@slaffik)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/535-incorrect-authentication-data/#post-9925908)
 * Hi,
 * 1) Update the plugin to the latest version.
    2) Contact your hosting support 
   with a question, why they are redirecting requests from `smtp.office365.com` 
   to `uk.mthservers.com`. They need to allow outbound request to send emails via
   SMTP.
 * You might need to change the SMTP Host to some kind of relay (hosting should 
   you provide all the correct values, ask them).
 *  Thread Starter [chazg](https://wordpress.org/support/users/chazg/)
 * (@chazg)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/535-incorrect-authentication-data/#post-9925980)
 * Hi Slava,
 * Thank you for the reply.
    I will contact the hosting company and see what they
   say. Will update the ticket in due cause.
 *  Plugin Author [Slava Abakumov](https://wordpress.org/support/users/slaffik/)
 * (@slaffik)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/535-incorrect-authentication-data/#post-9930253)
 * [@chazg](https://wordpress.org/support/users/chazg/)
 * They are really slow…
 *  Thread Starter [chazg](https://wordpress.org/support/users/chazg/)
 * (@chazg)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/535-incorrect-authentication-data/#post-9930419)
 * Hiya,
 * this is what the hosting company said:
 * In the error message, we have the below:
    Warning: stream_socket_enable_crypto():
   Peer certificate CN=uk.mthservers.com’ did not match expected CN=smtp.office365.
   com’ in /home/guardian/public_html/wp-includes/class-smtp.php on line 369
 * this is a certificate mismatch from your script, it is expecting Office 365 SSL,
   not our CN.
 * Could you rectify this first please.
 * Im not sure what they mean?
 * _[ [Please do not bump.](https://wordpress.org/support/guidelines/#do-not-bump-posts)]_
 *  Plugin Author [Slava Abakumov](https://wordpress.org/support/users/slaffik/)
 * (@slaffik)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/535-incorrect-authentication-data/#post-9942538)
 * Here is lots of information about certificates problems and what to do: [https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#certificate-verification-failure](https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting#certificate-verification-failure)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Warning: stream_socket_enable_crypto(): Peer certificate CN=`uk.mthservers.
com’’ is closed to new replies.

 * ![](https://ps.w.org/wp-mail-smtp/assets/icon-256x256.png?rev=1755440)
 * [WP Mail SMTP by WPForms - The Most Popular SMTP and Email Log Plugin](https://wordpress.org/plugins/wp-mail-smtp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-mail-smtp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-mail-smtp/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-mail-smtp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-mail-smtp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-mail-smtp/reviews/)

## Tags

 * [smtp error](https://wordpress.org/support/topic-tag/smtp-error/)

 * 3 replies
 * 2 participants
 * Last reply from: [Slava Abakumov](https://wordpress.org/support/users/slaffik/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/535-incorrect-authentication-data/#post-9942538)
 * Status: resolved