TLS certification still occurs even when MAIL_ENCRYPTION=null and MAIL_VERIFY_SSL=false #3793

Closed
opened 2026-02-05 07:29:24 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @nedelcu8 on GitHub (May 10, 2023).

Describe the Bug

We tried to disable encryption and send a test email , but the we still got the error :
Error thrown when sending a test email: Unable to connect with STARTTLS: stream_socket_enable_crypto(): Peer certificate CN=our-domain.com' did not match expected CN=localhost

Steps to Reproduce

1 edited .env file to set MAIL_ENCRYPTION=null
2 logged in to the admin account went to settings -> maintenance tab and sent a test email

Expected Behaviour

If encryption was set to null should not check the smtp certificate

Screenshots or Additional Context

No response

Browser Details

No response

Exact BookStack Version

BookStack v23.02.3

PHP Version

PHP 8.1.2

Hosting Environment

ubuntu 22.04 LTS

Originally created by @nedelcu8 on GitHub (May 10, 2023). ### Describe the Bug We tried to disable encryption and send a test email , but the we still got the error : Error thrown when sending a test email: Unable to connect with STARTTLS: stream_socket_enable_crypto(): Peer certificate CN=our-domain.com' did not match expected CN=[localhost](https://localhost/) ### Steps to Reproduce 1 edited .env file to set MAIL_ENCRYPTION=null 2 logged in to the admin account went to settings -> maintenance tab and sent a test email ### Expected Behaviour If encryption was set to null should not check the smtp certificate ### Screenshots or Additional Context _No response_ ### Browser Details _No response_ ### Exact BookStack Version BookStack v23.02.3 ### PHP Version PHP 8.1.2 ### Hosting Environment ubuntu 22.04 LTS
OVERLORD added the 🐛 Bug label 2026-02-05 07:29:24 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 10, 2023):

Hi @nedelcu8,
The MAIL_VERIFY_SSL option was only added in v23.05. Please update your instance to try that setting again.
Even with no encryption set on the BookStack side, opportunistic upgrading to TLS/SSL may still take place during communication with the STMP server.

@ssddanbrown commented on GitHub (May 10, 2023): Hi @nedelcu8, The `MAIL_VERIFY_SSL` option was only added in v23.05. Please update your instance to try that setting again. Even with no encryption set on the BookStack side, opportunistic upgrading to TLS/SSL may still take place during communication with the STMP server.
Author
Owner

@nedelcu8 commented on GitHub (May 10, 2023):

Hi @nedelcu8, The MAIL_VERIFY_SSL option was only added in v23.05. Please update your instance to try that setting again. Even with no encryption set on the BookStack side, opportunistic upgrading to TLS/SSL may still take place during communication with the STMP server.

That fixed it , thank you!

@nedelcu8 commented on GitHub (May 10, 2023): > Hi @nedelcu8, The `MAIL_VERIFY_SSL` option was only added in v23.05. Please update your instance to try that setting again. Even with no encryption set on the BookStack side, opportunistic upgrading to TLS/SSL may still take place during communication with the STMP server. That fixed it , thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3793