Misconfigured server certificate

Hello,
today i got an error notification from wp mail smtp plugin that my email can’t be sent due to a Misconfigured server certificate, everything was fine yesterday i don’t know what happened suddenly but i got that error and here is the full error log:
Versions:
WordPress: 6.0
WordPress MS: No
PHP: 7.4.29
WP Mail SMTP: 3.4.0

Params:
Mailer: smtp
Constants: No
ErrorInfo: SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Host: mail.mydomain.com
Port: 587
SMTPSecure: tls
SMTPAutoTLS: bool(true)
SMTPAuth: bool(true)

Server:
OpenSSL: OpenSSL 1.1.1f 31 Mar 2020
Apache.mod_security: No

Debug:
Email Source: WP Mail SMTP
Mailer: Other SMTP
SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

SMTP Debug:
2022-06-02 08:48:18 Connection: opening to mail.mydomain.com:587, timeout=300, options=array()

2022-06-02 08:48:18 Connection: opened

2022-06-02 08:48:18 SERVER → CLIENT: 220 mail.mydomain.com ESMTP Postfix

2022-06-02 08:48:18 CLIENT → SERVER: EHLO mydomain.com

2022-06-02 08:48:18 SERVER → CLIENT: 250-mail.mydomain.com250-PIPELINING250-SIZE 30720000250-ETRN250-STARTTLS250-ENHANCEDSTATUSCODES250-8BITMIME250-DSN250 CHUNKING

2022-06-02 08:48:18 CLIENT → SERVER: STARTTLS

2022-06-02 08:48:18 SERVER → CLIENT: 220 2.0.0 Ready to start TLS

2022-06-02 08:48:18 Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [/home/mydomain.com/public_html/wp-includes/PHPMailer/SMTP.php line 468]

SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

2022-06-02 08:48:18 CLIENT → SERVER: QUIT

2022-06-02 08:48:18

2022-06-02 08:48:18

2022-06-02 08:48:18 Connection: closed

SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

can anyone help me pls to fix this?!

thanks.

Try issue SSL for mail server and if it fail see logs why

1 Like

it issued correctly and the problem still remains

and i tried again and still got the error:

Versions:
WordPress: 6.0
WordPress MS: No
PHP: 7.4.29
WP Mail SMTP: 3.4.0

Params:
Mailer: smtp
Constants: No
ErrorInfo: SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
Host: mail.domain.com
Port: 587
SMTPSecure: tls
SMTPAutoTLS: bool(true)
SMTPAuth: bool(true)

Server:
OpenSSL: OpenSSL 1.1.1f 31 Mar 2020
Apache.mod_security: No

Debug:
Email Source: WP Mail SMTP
Mailer: Other SMTP
SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

SMTP Debug:
2022-06-02 09:33:58 Connection: opening to mail.domain.com:587, timeout=300, options=array()

2022-06-02 09:33:58 Connection: opened

2022-06-02 09:33:58 SERVER → CLIENT: 220 domain.com ESMTP Postfix

2022-06-02 09:33:58 CLIENT → SERVER: EHLO domain.com

2022-06-02 09:33:58 SERVER → CLIENT: 250-domain.com250-PIPELINING250-SIZE 30720000250-ETRN250-STARTTLS250-ENHANCEDSTATUSCODES250-8BITMIME250-DSN250 CHUNKING

2022-06-02 09:33:58 CLIENT → SERVER: STARTTLS

2022-06-02 09:33:58 SERVER → CLIENT: 220 2.0.0 Ready to start TLS

2022-06-02 09:33:58 Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed [/home/domain.com/public_html/wp-includes/PHPMailer/SMTP.php line 468]

SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

2022-06-02 09:33:58 CLIENT → SERVER: QUIT

2022-06-02 09:33:58

2022-06-02 09:33:58

2022-06-02 09:33:58 Connection: closed

SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

Hello @Ahmed0

it seems like this is caused from within the WordPress SMTP plugin, rather than the server itself.

  1. Can you make a try to send emails from your email account that you use in this plugin, straight through Rainloop, and share the logs again? If the mails are sent properly, then Server Certificate is working correctly. It may be server issue indeed, but let’s be sure for this first.

  2. Please make sure that you use the correct configuration for the SMTP plugin that you use inside the WP installation. You use the proper email account (created from Cyberpanel), proper port and credentials.

2 Likes

I tried sending from straight through Rainloop and it worked fine so that narrowed the issue to the plugin configuration as you mentioned and i found it very weird my SMTP Host
was mail.mydomain.com and it has been for 130 days without any problem but suddenly i found out that my emails are hosted under mydomain.com directly and not the mail.mydomain.com so i changed the SMTP Host setting in the plugin and removed the mail. and it worked fine and i still has no idea what caused this.
but the most important thing is i must say thanks a lot for your help i really appreciate you taking the time to help me .

Oh great! I’m happy I could help. Thanks for the detailed explanation of the exact fix, so others can benefit also! Best regards!

2 Likes

This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.