File tree Expand file tree Collapse file tree 3 files changed +3
-5
lines changed
Common/src/Interop/Windows/SspiCli
System.Net.Security/src/System/Net Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -335,13 +335,12 @@ internal sealed class SafeFreeCredential_SECURITY : SafeFreeCredentials
335335 {
336336#pragma warning disable 0649
337337 // This is used only by SslStream but it is included elsewhere
338- public X509Certificate ? LocalCertificate ;
338+ public bool HasLocalCertificate ;
339339#pragma warning restore 0649
340340 public SafeFreeCredential_SECURITY ( ) : base ( ) { }
341341
342342 protected override bool ReleaseHandle ( )
343343 {
344- LocalCertificate ? . Dispose ( ) ;
345344 return Interop . SspiCli . FreeCredentialsHandle ( ref _handle ) == 0 ;
346345 }
347346 }
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ internal static bool IsLocalCertificateUsed(SafeFreeCredentials? _credentialsHan
105105 // This is TLS Resumed session. Windows can fail to query the local cert bellow.
106106 // Instead, we will determine the usage form used credentials.
107107 SafeFreeCredential_SECURITY creds = ( SafeFreeCredential_SECURITY ) _credentialsHandle ! ;
108- return creds . LocalCertificate != null ;
108+ return creds . HasLocalCertificate ;
109109 }
110110
111111 SafeFreeCertContext ? localContext = null ;
Original file line number Diff line number Diff line change @@ -233,8 +233,7 @@ public static SafeFreeCredentials AcquireCredentialsHandle(SslAuthenticationOpti
233233 if ( newCredentialsRequested && sslAuthenticationOptions . CertificateContext != null )
234234 {
235235 SafeFreeCredential_SECURITY handle = ( SafeFreeCredential_SECURITY ) cred ;
236- // We need to create copy to avoid Disposal issue.
237- handle . LocalCertificate = new X509Certificate2 ( sslAuthenticationOptions . CertificateContext . TargetCertificate ) ;
236+ handle . HasLocalCertificate = true ;
238237 }
239238
240239 return cred ;
You can’t perform that action at this time.
0 commit comments