Create a dotnetty server using TlsHandler.Server(certificate)
Run/Debug the server using a user which has NO rights to the cert. private key (check using mmc under cert->All Tasks->Manage Private Keys... )
Start the server and send something to it (e.g. using Packet Sender utility)
Observed behavior: connection is made, handshake silently fails. When debugging, the HandleHandshakeCompleted goes into 'case TaskStatus.Faulted:' but nothing is propagated.
The NotifyHandshakeFailure method evaluates 'if (!this.state.HasAny(TlsHandlerState.AuthenticationCompleted))' as false, thus the exception is silently ignored:
{"The credentials supplied to the package were not recognized"}
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)\r\n
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)\r\n
at System.Net.Security.SslStream.EndAuthenticateAsServer(IAsyncResult asyncResult)\r\n
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)"
PS C:\Windows\system32> New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname pcname.domain.net -KeyUsage CRLSign,CertSign,KeyAgreement,DataEncipherment,KeyEnc ipherment,NonRepudiation,DigitalSignature -KeyUsageProperty All
Create a dotnetty server using TlsHandler.Server(certificate)
Run/Debug the server using a user which has NO rights to the cert. private key (check using mmc under cert->All Tasks->Manage Private Keys... )
Start the server and send something to it (e.g. using Packet Sender utility)
Observed behavior: connection is made, handshake silently fails. When debugging, the HandleHandshakeCompleted goes into 'case TaskStatus.Faulted:' but nothing is propagated. The NotifyHandshakeFailure method evaluates 'if (!this.state.HasAny(TlsHandlerState.AuthenticationCompleted))' as false, thus the exception is silently ignored:
{"The credentials supplied to the package were not recognized"}
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)\r\n
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)\r\n
at System.Net.Security.SslStream.EndAuthenticateAsServer(IAsyncResult asyncResult)\r\n
at System.Threading.Tasks.TaskFactory
1.FromAsyncCoreLogic(IAsyncResult iar, Func
2 endFunction, Action1 endAction, Task
1 promise, Boolean requiresSynchronization)"