Skip to content

Commit ae93fca

Browse files
WL#14666: Fixing the code after the review
1 parent 66b1ba5 commit ae93fca

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

xmysqlnd/xmysqlnd_session.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,10 @@ Crypt_methods prepare_crypt_methods(const Tls_versions& tls_versions)
988988
{
989989
int tls_crypt_methods{ 0 };
990990
for (Tls_version tls_version : tls_versions) {
991+
if( tls_version == Tls_version::tls_v1_0 || tls_version == Tls_version::tls_v1_1 ) {
992+
// Those crypto methods should not be used.
993+
php_error_docref(nullptr, E_WARNING, "TLSv1 and TLSv1.1 are deprecated starting from MySQL 8.0.25 and should not be used.");
994+
}
991995
php_stream_xport_crypt_method_t tls_crypt_method{ to_stream_crypt_method(tls_version) };
992996
tls_crypt_methods |= tls_crypt_method;
993997
}
@@ -3005,9 +3009,6 @@ void Extract_client_option::set_tls_versions(const std::string& raw_tls_versions
30053009
}
30063010
for (const auto& tls_version_str : tls_versions) {
30073011
const Tls_version tls_version{ parse_tls_version(tls_version_str) };
3008-
if( tls_version == Tls_version::tls_v1_0 || tls_version == Tls_version::tls_v1_1 ) {
3009-
php_error_docref(nullptr, E_WARNING, "TLSv1 and TLSv1.1 are deprecated starting from MySQL 8.0.25 and should not be used.");
3010-
}
30113012
auth.tls_versions.push_back(tls_version);
30123013
}
30133014
}

0 commit comments

Comments
 (0)