Skip to content

Commit b774516

Browse files
Quality Patch AC-14984 and AC-14985 (#202)
* QPT patch to fix github issue magento/magento2/39914 and magento/magento2/39947 * Fixed CR notes. --------- Co-authored-by: Oleksandr Gorbivskyi <[email protected]>
1 parent 68e9a25 commit b774516

File tree

4 files changed

+108
-1
lines changed

4 files changed

+108
-1
lines changed

patches-info.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff --git a/vendor/magento/framework-amqp/Connection/Factory.php b/vendor/magento/framework-amqp/Connection/Factory.php
2+
--- a/vendor/magento/framework-amqp/Connection/Factory.php
3+
+++ b/vendor/magento/framework-amqp/Connection/Factory.php (date 1750251863102)
4+
@@ -39,6 +39,7 @@
5+
// Set SSL options if SSL is enabled
6+
if ($options->isSslEnabled()) {
7+
$config->setIsSecure(true);
8+
+ $config->setNetworkProtocol(\Magento\Framework\Amqp\Config::SSL);
9+
$sslOptions = $options->getSslOptions();
10+
if ($sslOptions) {
11+
if (isset($sslOptions['cafile'])) {

patches/os/AC-14985_2.4.8.patch

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
diff --git a/vendor/magento/module-email/Model/Transport.php b/vendor/magento/module-email/Model/Transport.php
2+
index b46e4564e327f..02631e9564c2a 100644
3+
--- a/vendor/magento/module-email/Model/Transport.php
4+
+++ b/vendor/magento/module-email/Model/Transport.php
5+
@@ -16,6 +16,7 @@
6+
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
7+
use Symfony\Component\Mailer\Transport\Smtp\Auth\LoginAuthenticator;
8+
use Symfony\Component\Mailer\Transport\Smtp\Auth\PlainAuthenticator;
9+
+use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransportFactory;
10+
use Magento\Framework\App\Config\ScopeConfigInterface;
11+
use Magento\Framework\App\ObjectManager;
12+
use Magento\Framework\Exception\MailException;
13+
@@ -78,6 +79,11 @@ class Transport implements TransportInterface
14+
*/
15+
private const XML_PATH_SSL = 'system/smtp/ssl';
16+
17+
+ /**
18+
+ * SMTP scheme constant
19+
+ */
20+
+ private const SMTP_SCHEME = 'smtp';
21+
+
22+
/**
23+
* Whether return path should be set or no.
24+
*
25+
@@ -146,7 +152,7 @@ public function __construct(
26+
public function getTransport(): SymfonyTransportInterface
27+
{
28+
if (!isset($this->symfonyTransport)) {
29+
- $transportType = $this->scopeConfig->getValue(self::XML_PATH_TRANSPORT);
30+
+ $transportType = $this->scopeConfig->getValue(self::XML_PATH_TRANSPORT, ScopeInterface::SCOPE_STORE);
31+
if ($transportType === 'smtp') {
32+
$this->symfonyTransport = $this->createSmtpTransport();
33+
} else {
34+
@@ -170,19 +176,27 @@ private function createSmtpTransport(): SymfonyTransportInterface
35+
$password = $this->scopeConfig->getValue(self::XML_PATH_PASSWORD, ScopeInterface::SCOPE_STORE);
36+
$auth = $this->scopeConfig->getValue(self::XML_PATH_AUTH, ScopeInterface::SCOPE_STORE);
37+
$ssl = $this->scopeConfig->getValue(self::XML_PATH_SSL, ScopeInterface::SCOPE_STORE);
38+
- $tls = false;
39+
40+
+ $options = [];
41+
if ($ssl === 'tls') {
42+
- $tls = true;
43+
+ $options['tls'] = true;
44+
+ } elseif ($ssl === 'ssl') {
45+
+ $options['ssl'] = true;
46+
+ $options['verify_peer'] = true;
47+
+ $options['verify_peer_name'] = true;
48+
}
49+
50+
- $transport = new EsmtpTransport($host, $port, $tls);
51+
- if ($username) {
52+
- $transport->setUsername($username);
53+
- }
54+
- if ($password) {
55+
- $transport->setPassword($password);
56+
- }
57+
+ $dsn = new Dsn(
58+
+ self::SMTP_SCHEME,
59+
+ $host,
60+
+ $username,
61+
+ $password,
62+
+ $port,
63+
+ $options
64+
+ );
65+
+
66+
+ $factory = new EsmtpTransportFactory();
67+
+ $transport = $factory->create($dsn);
68+
69+
switch ($auth) {
70+
case 'plain':

support-patches.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,30 @@
11
{
2+
"AC-14985": {
3+
"categories": [
4+
"Emails"
5+
],
6+
"title": "Fixes the SMTP mail send with tls and 2.4.8.",
7+
"packages": {
8+
"magento/magento2-base": {
9+
">=2.4.8 <2.4.8-p2": {
10+
"file": "os/AC-14985_2.4.8.patch"
11+
}
12+
}
13+
}
14+
},
15+
"AC-14984": {
16+
"categories": [
17+
"Other"
18+
],
19+
"title": "Fixes the \"Invalid frame type 21\" error on RabbitMQ SSL connection after minor upgrade 2.4.6-p9 -> 2.4.6-p10.",
20+
"packages": {
21+
"magento/magento2-base": {
22+
">=2.4.6-p10 <2.4.6-p12": {
23+
"file": "os/AC-14984_2.4.6-p10.patch"
24+
}
25+
}
26+
}
27+
},
228
"LYNX-839": {
329
"categories": [
430
"GraphQL"

0 commit comments

Comments
 (0)