Skip to content

Commit 2855cae

Browse files
Add TLS v1.3 to SMTP connection - closes #5070
1 parent cc2bec7 commit 2855cae

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

overrides/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ public function startTLS()
9191
// To support modern tls we allow explicit tls1.0, tls1.1, tls1.2
9292
// Ssl3 and older are not allowed because they are vulnerable
9393
// @TODO make tls arguments configurable
94-
return stream_socket_enable_crypto($this->stream, true, STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT);
94+
$crypto_method = STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
95+
// https://github.com/freescout-help-desk/freescout/issues/5070
96+
if (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT')) {
97+
$crypto_method = $crypto_method | STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT;
98+
}
99+
return stream_socket_enable_crypto($this->stream, true, $crypto_method);
95100
}
96101

97102
/**

0 commit comments

Comments
 (0)