Specifically we fail with this message:
[30-Apr-2017 14:05:18 UTC] PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure in /home/xxxxxxxx/public_html/phpmailer/PHPMailer-5.2.8/class.smtp.php on line 272
Googling this we find reports of similar errors during upgrades from PHP 5.5 - but these all stem from improved certificate verification introduced in PHP 5.6. This doesnt seem to be our issue. For instance - following the PHPMailer troubleshooting wiki - we are able to connect to the smtp server with openSSL.
openssl s_client -starttls smtp -crlf -connect vps.ourserver.com:587
.
.
SSL handshake has read 5284 bytes and written 468 bytes
.
.
Verify return code: 0 (ok)
Turning SMTBDebug on (level 4) doesn't really show anything useful:
2017-04-30 16:04:54 CLIENT -> SERVER: STARTTLS
2017-04-30 16:04:54 SMTP -> get_lines(): $data is ""
2017-04-30 16:04:54 SMTP -> get_lines(): $str is "220 TLS go ahead
"
2017-04-30 16:04:54 SERVER -> CLIENT: 220 TLS go ahead
2017-04-30 16:04:54 SMTP Error: Could not connect to SMTP host.
2017-04-30 16:04:54 CLIENT -> SERVER: QUIT
As stated - this problem started immediately after the PHP upgrade. No changes to code or SSL/Certificate configurations.
Suggestions on next steps to troubleshoot?
Edit: It was suggested that this question may have been solved previously SSL3_GET_SERVER_CERTIFICATE.. but it is a different error message (and I did try overriding the smtpoptions as suggested - to no effect).