fix: 兼容 MySQL 代理 packet out of order
Co-authored-by: zipg <4047349+zipg@users.noreply.github.com>
This commit is contained in:
1 parent
ed9fe57617
commit
63ef26b25a
1 file changed
+10
@@ -1068,6 +1068,9 @@ fn mysql_error_should_retry_without_ssl(error: &str) -> bool {
|
|||||||
|| error.contains("handshake")
|
|| error.contains("handshake")
|
||||||
|| error.contains("tls connection")
|
|| error.contains("tls connection")
|
||||||
|| error.contains("server closed session")
|
|| error.contains("server closed session")
|
||||||
|
// Some older MySQL proxies report a failed preferred-TLS probe as a
|
||||||
|
// protocol packet error instead of a TLS handshake error.
|
||||||
|
|| error.contains("packet out of order")
|
||||||
// Some MySQL-compatible servers report a preferred-TLS attempt as a
|
// Some MySQL-compatible servers report a preferred-TLS attempt as a
|
||||||
// normal server error instead of a TLS handshake error.
|
// normal server error instead of a TLS handshake error.
|
||||||
|| (error.contains("client asked for ssl") && error.contains("server does not have this capability"))
|
|| (error.contains("client asked for ssl") && error.contains("server does not have this capability"))
|
||||||
@@ -4206,6 +4209,13 @@ UNIQUE KEY(`tenant_id`, `name``part`)
|
|||||||
assert!(mysql_error_should_retry_without_ssl(error));
|
assert!(mysql_error_should_retry_without_ssl(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn mysql_packet_out_of_order_can_retry_without_ssl() {
|
||||||
|
let error = "MySQL connection failed: Input/output error: Input/output error: packet out of order";
|
||||||
|
|
||||||
|
assert!(mysql_error_should_retry_without_ssl(error));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn mysql_tcp_keepalive_uses_milliseconds_not_seconds() {
|
fn mysql_tcp_keepalive_uses_milliseconds_not_seconds() {
|
||||||
assert_eq!(MYSQL_TCP_KEEPALIVE_MS, 30_000);
|
assert_eq!(MYSQL_TCP_KEEPALIVE_MS, 30_000);
|
||||||
|
|||||||
Reference in new issue
Block a user