I get this warning on postfix debug log:
warning: TLS library problem: error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../ssl/record/ssl3_record.c:332:
.
I was testing PHPmailer and I got this error when I tried to send an email:
2022-01-08 Connection: opening to ssl://mail.example.com:587, timeout=30, options=array ( 'ssl' => array ( 'verify_peer' => true, 'verify_peer_name' => true, 'allow_self_signed' => false, ),)
2022-01-08 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:error:1408F10B:SSL routines:ssl3_get_record:wrong version number [/var/www/example.com/html/vendor/phpmailer/phpmailer/src/SMTP.php line 388]
2022-01-08 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/var/www/example.com/html/vendor/phpmailer/phpmailer/src/SMTP.php line 388]
2022-01-08 Connection failed. Error #2: stream_socket_client(): Unable to connect to ssl://mail.example.com:587 (Unknown error) [/var/www/example.com/html/vendor/phpmailer/phpmailer/src/SMTP.php line 388]
2022-01-08 SMTP ERROR: Failed to connect to server: (0)
I think these errors are correlated. Why I see the first warning and how can I fix that?