From cf14126aab0d4f142fa47a8ffde7964245984534 Mon Sep 17 00:00:00 2001 From: Luwei Ge Date: Tue, 16 Sep 2025 21:08:05 +0000 Subject: [PATCH] set max_frame_size in server/client handshake req --- credentials/alts/internal/handshaker/handshaker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/credentials/alts/internal/handshaker/handshaker.go b/credentials/alts/internal/handshaker/handshaker.go index f4974b504b5a..18e9389f8948 100644 --- a/credentials/alts/internal/handshaker/handshaker.go +++ b/credentials/alts/internal/handshaker/handshaker.go @@ -41,7 +41,9 @@ import ( const ( // The maximum byte size of receive frames. - frameLimit = 64 * 1024 // 64 KB + frameLimit = 64 * 1024 // 64 KB + // The maximum frame size for the handshake request. + maxFrameSize = 1024 * 1024 // 1 MB rekeyRecordProtocolName = "ALTSRP_GCM_AES128_REKEY" ) @@ -194,6 +196,7 @@ func (h *altsHandshaker) ClientHandshake(ctx context.Context) (net.Conn, credent LocalIdentity: h.clientOpts.ClientIdentity, TargetName: h.clientOpts.TargetName, RpcVersions: h.clientOpts.RPCVersions, + MaxFrameSize: maxFrameSize, }, }, } @@ -248,6 +251,7 @@ func (h *altsHandshaker) ServerHandshake(ctx context.Context) (net.Conn, credent HandshakeParameters: params, InBytes: p[:n], RpcVersions: h.serverOpts.RPCVersions, + MaxFrameSize: maxFrameSize, }, }, }