1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/src/tls/TlsClientProtocol.cs b/crypto/src/tls/TlsClientProtocol.cs
index 8e31fa6c8..99d088622 100644
--- a/crypto/src/tls/TlsClientProtocol.cs
+++ b/crypto/src/tls/TlsClientProtocol.cs
@@ -1694,7 +1694,7 @@ namespace Org.BouncyCastle.Tls
* RFC 8446 4.2.1. In compatibility mode [..], this field MUST be non-empty, so a client
* not offering a pre-TLS 1.3 session MUST generate a new 32-byte value.
*/
- if (legacy_session_id.Length < 1)
+ if (legacy_session_id.Length < 1 && TlsUtilities.ShouldUseCompatibilityMode(m_tlsClient))
{
legacy_session_id = m_tlsClientContext.NonceGenerator.GenerateNonce(32);
}
|