Bug #10317
closedSMTP notifications validating SSL when option disabled
100%
Description
The function send_smtp_message in etc/inc/notices.inc will try to verify the SSL certificate, even though the Validate SSL/TLS option is disabled in System -> Advanced -> Notifications.
This results in the error:
[05-Mar-2020 22:04:06 America/Chicago] PHP Warning: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/local/share/pear/Net/Socket.php on line 159
And the notification is not sent.
The default php ssl context options are verify_peer = true and verify_peer_name = true.
When sslvalidate is disabled in the config, the send_smtp_message code only sets verify_peer_name to false. verify_peer is still true.
verify_peer is defined as "Require verification of SSL certificate used"
Adding verify_peer=false to the socket_options when sslvalidate is disabled resolves the error and the notification is sent.
Updated by Viktor Gurov over 4 years ago
- Category set to Notifications
Correct,
from https://www.php.net/manual/en/context.ssl.php:
verify_peer boolean Require verification of SSL certificate used. Defaults to TRUE. verify_peer_name boolean Require verification of peer name. Defaults to TRUE.
Updated by Jim Pingle over 4 years ago
- Status changed from New to Pull Request Review
- Target version set to 2.5.0
Updated by Renato Botelho over 4 years ago
- Status changed from Pull Request Review to Feedback
- Assignee set to Renato Botelho
- % Done changed from 0 to 100
PR has been merged. Thanks!
Updated by Jim Pingle over 4 years ago
- Target version changed from 2.5.0 to 2.4.5-p1
Updated by Viktor Gurov over 4 years ago
- Status changed from Feedback to Resolved
works as expected on 2.4.5-p1 - no SSL errors if 'Validate SSL/TLS' checkbox is not set