@@ -112,10 +112,10 @@ public static SecurityStatusPal InitializeSecurityContext(ref SafeFreeCredential
112112 return SecurityStatusAdapterPal . GetSecurityStatusPalFromNativeInt ( errorCode ) ;
113113 }
114114
115- public static SecurityStatusPal Renegotiate ( ref SafeFreeCredentials ? credentialsHandle , ref SafeDeleteSslContext ? context , SslAuthenticationOptions sslAuthenticationOptions , out byte [ ] ? outputBuffer )
115+ public static SecurityStatusPal Renegotiate ( ref SafeFreeCredentials ? credentialsHandle , ref SafeDeleteSslContext ? context , SslAuthenticationOptions sslAuthenticationOptions , out byte [ ] ? outputBuffer )
116116 {
117117 byte [ ] ? output = Array . Empty < byte > ( ) ;
118- SecurityStatusPal status = AcceptSecurityContext ( ref credentialsHandle , ref context , Span < byte > . Empty , ref output , sslAuthenticationOptions ) ;
118+ SecurityStatusPal status = AcceptSecurityContext ( ref credentialsHandle , ref context , Span < byte > . Empty , ref output , sslAuthenticationOptions ) ;
119119 outputBuffer = output ;
120120 return status ;
121121 }
@@ -139,8 +139,7 @@ public static SafeFreeCredentials AcquireCredentialsHandle(SslStreamCertificateC
139139 if ( newCredentialsRequested && certificateContext != null )
140140 {
141141 SafeFreeCredential_SECURITY handle = ( SafeFreeCredential_SECURITY ) cred ;
142- // We need to create copy to avoid Disposal issue.
143- handle . LocalCertificate = new X509Certificate2 ( certificateContext . Certificate ) ;
142+ handle . HasLocalCertificate = true ;
144143 }
145144
146145 return cred ;
@@ -270,11 +269,11 @@ public static unsafe SafeFreeCredentials AcquireCredentialsHandleSchCredentials(
270269 Interop . SspiCli . SCH_CREDENTIALS credential = default ;
271270 credential . dwVersion = Interop . SspiCli . SCH_CREDENTIALS . CurrentVersion ;
272271 credential . dwFlags = flags ;
273- Interop . Crypt32 . CERT_CONTEXT * certificateHandle = null ;
272+ Interop . Crypt32 . CERT_CONTEXT * certificateHandle = null ;
274273 if ( certificate != null )
275274 {
276275 credential . cCreds = 1 ;
277- certificateHandle = ( Interop . Crypt32 . CERT_CONTEXT * ) certificate . Handle ;
276+ certificateHandle = ( Interop . Crypt32 . CERT_CONTEXT * ) certificate . Handle ;
278277 credential . paCred = & certificateHandle ;
279278 }
280279
0 commit comments