Skip to content

Commit ca42a8e

Browse files
committed
Correctly set sendTrustList flag when saving credentials to cache (dotnet#92731)
1 parent 4ae54f2 commit ca42a8e

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Protocol.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -817,15 +817,12 @@ private SecurityStatusPal GenerateToken(ReadOnlySpan<byte> inputBuffer, ref byte
817817
cachedCreds = _sslAuthenticationOptions.IsServer
818818
? AcquireServerCredentials(ref thumbPrint)
819819
: AcquireClientCredentials(ref thumbPrint);
820-
821-
if (cachedCreds && _sslAuthenticationOptions.IsServer)
822-
{
823-
sendTrustList = _sslAuthenticationOptions.CertificateContext?.Trust?._sendTrustInHandshake ?? false;
824-
}
825820
}
826821

827822
if (_sslAuthenticationOptions.IsServer)
828823
{
824+
sendTrustList = _sslAuthenticationOptions.CertificateContext?.Trust?._sendTrustInHandshake ?? false;
825+
829826
status = SslStreamPal.AcceptSecurityContext(
830827
ref _credentialsHandle!,
831828
ref _securityContext,

0 commit comments

Comments
 (0)