Skip to content

Connection could not be established with host "ssl://localhost:587": stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol #40028

Open
@maximus-sallam

Description

@maximus-sallam

Preconditions and environment

  • Magento version

Tested in 2.4.7-p4 and 2.4.8.
The bug is only present in 2.4.8.

  • Anything else that would help a developer reproduce the bug

`[user@cloudhost vendor]$ cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"`

[user@cloudhost vendor]$ free -mh total used free shared buff/cache available Mem: 104G 70G 7.9G 3.3G 25G 29G Swap: 6.0G 3.4G 2.6G

[user@cloudhost vendor]$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 32 On-line CPU(s) list: 0-31 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 32 NUMA node(s): 1 Vendor ID: AuthenticAMD CPU family: 23 Model: 1 Model name: AMD EPYC Processor (with IBPB) Stepping: 2 CPU MHz: 2994.372 BogoMIPS: 5988.74 Hypervisor vendor: KVM Virtualization type: full L1d cache: 32K L1i cache: 64K L2 cache: 512K L3 cache: 8192K NUMA node0 CPU(s): 0-31 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm rep_good nopl cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext perfctr_core ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 virt_ssbd arat umip

[user@cloudhost vendor]$ httpd -v Server version: Apache/2.4.54 (CentOS) Server built: Aug 12 2022 20:16:29

[a19b88da@cloudhost-2836220 vendor]$ nginx -v nginx version: nginx/1.24.0

Note: Apache serves the application and SSL is terminated with Apache,
NginX is used for reverse proxy caching,

[user@cloudhost vendor]$ mysql -V mysql Ver 15.1 Distrib 10.5.16-MariaDB, for Linux (x86_64) using readline 5.1

[user@cloudhost vendor]$ php -v PHP 8.3.8 (cli) (built: Jun 4 2024 14:53:17) (NTS gcc x86_64) Copyright (c) The PHP Group Zend Engine v4.3.8, Copyright (c) Zend Technologies with Zend OPcache v8.3.8, Copyright (c), by Zend Technologies

└─$ systemctl status php83-php-fpm.service ● php83-php-fpm.service - The PHP FastCGI Process Manager Loaded: loaded (/usr/lib/systemd/system/php83-php-fpm.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2025-06-10 15:16:56 UTC; 2 weeks 4 days ago Main PID: 14345 (php-fpm) Status: "Processes active: 0, idle: 0, Requests: 4327, slow: 0, Traffic: 0.00req/sec" Tasks: 23 Memory: 64.9M CGroup: /system.slice/php83-php-fpm.service ├─14345 php-fpm: master process (/etc/opt/remi/php83/php-fpm.conf) ├─14358 /usr/bin/newrelic-daemon --agent --pidfile /var/run/php83-newrelic-daemon.pid --logfile /var/log/newrelic/php83-newrelic-daemon.log --po... └─14364 /usr/bin/newrelic-daemon --agent --pidfile /var/run/php83-newrelic-daemon.pid --logfile /var/log/newrelic/php83-newrelic-daemon.log --po...

└─$ dovecot --version 2.3.10.1 (a3d0e1171)

Steps to reproduce

  1. Install Mageplaza-smtp

composer require mageplaza/module-smtp php bin/magento setup:upgrade php bin/magento setup:static-content:deploy

  1. Try to add a TLS connection using port 587 to the Mageplaza-smtp configuration:

Image

  1. When you run the "Send Test Email" the following error is generated:

Image

  1. I narrowed the problem down to two composer modules:

[user@cloudhost vendor]$ grep -r 'ssl://' symfony/ symfony/http-client/HttpClientTrait.php: $proxyUrl = 'ssl://'.$proxy['host'].':'.($proxy['port'] ?? '443'); symfony/mailer/Transport/Smtp/Stream/SocketStream.php: $this->url = 'ssl://'.$this->url;

  1. Removing the string 'ssl://'. from both files resolves the issue.

Note: Both these composer modules are present in both 2.4.7-p4 and 2.4.8.

Expected result

I expect the email to send and the test to succeed.

Actual result

error message shown in screenshot above.

Additional information

will provide later

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready for Confirmation

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions