-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Assert for TlsHandler.MediationStream #51
base: main
Are you sure you want to change the base?
Conversation
@@ -60,6 +63,7 @@ public void ExpandSource(int count) | |||
if (sslBuffer.IsEmpty) | |||
{ | |||
// there is no pending read operation - keep for future | |||
Debug.Assert(_readCompletionSource == null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReadAsync can also be called with zero length array, and it should be finished if any data is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
真是仔细啊, 👍
MqttServerAndClient not failed this time, but see on some other test(TlsHandlerTest.TlsRead) in net5.0_windows
|
能否把证书一块更新下? |
…and seems obsoleted and no longer work on net5.0+ubuntu20.04 Generated with ``` openssl genrsa -out ssl.key 2048 openssl req -new -x509 -key ssl.key -out dotnetty.com.cer -days 3650 -subj /CN=dotnetty.com openssl req -new -x509 -key ssl.key -out contoso.com.cer -days 3650 -subj /CN=contoso.com openssl pkcs12 -export -out dotnetty.com.pfx -inkey ssl.key -in dotnetty.com.cer openssl pkcs12 -export -out contoso.com.pfx -inkey ssl.key -in contoso.com.cer ``` password="password"
… many tests for it
奇怪了, 怎么我改了测试之后mac下都跑不过了,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非windows平台的测试还是要把 SslProtocols.Tls 去掉
Message:
System.Security.Authentication.AuthenticationException : Authentication failed, see inner exception.
---- System.ComponentModel.Win32Exception : 因为算法不同,客户端和服务器无法通信。(The client and server cannot communicate, because they do not possess a common algorithm.)
Stack Trace:
SslStream.ForceAuthenticationAsync[TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte[] reAuthenticationData, Boolean isApm)
TaskUtil.WithTimeout(Task taskToComplete, TimeSpan timeout) line 428
TlsHandlerTest.SetupStreamAndChannelAsync(Boolean isClient, IEventExecutor executor, IWriteStrategy writeStrategy, SslProtocols serverProtocol, SslProtocols clientProtocol, List`1 writeTasks) line 344
TlsHandlerTest.TlsWrite(Int32[] frameLengths, Boolean isClient, SslProtocols serverProtocol, SslProtocols clientProtocol) line 233
TlsHandlerTest.TlsWrite(Int32[] frameLengths, Boolean isClient, SslProtocols serverProtocol, SslProtocols clientProtocol) line 271
--- End of stack trace from previous location ---
----- Inner Stack Trace -----
Standard Output:
frameLengths: 1
isClient: True
serverProtocol: Tls13
clientProtocol: Tls, Tls11, Tls12, Tls13
writeStrategy: as-is
具体包含以下测试, 我看把TlsRead的writeStrategy改成个枚举传入
|
TlsRead最开始VS是可以分组的,后来随着VS的升级...... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要不 MqttServerAndClient 先这样忽略掉?
#if LOCALTEST
[Fact]
#else
[Fact(Skip = "Azure DevOps")]
#endif
设了DisableDiscoveryEnumeration好像没用, 而且不知道从哪缓存了一个旧版测试的名字, 先不管这个了 测试的名字全显示成一样的是pipeline本身和xunit+vstest的兼容性问题, 可惜连接过期了看不到当初给的规避方案了, 而且估计短时间内也不会修, 虽然不知道为啥dotnet/runtime本身用到的测试好像都是对的... MqttServerAndClient 那个我会修的, 因为现在还剩下的基本上都是Azure/DotNetty#374那个问题, 就是我最初加的那个Assert, 但可能要周末才有空改, 而且这块本身的代码也是一团乱麻, 搞得我都想去抄system.io.pipelines的实现或者引用了... |
😃 👍 |
不知道是不是最近win10预览版的问题, 现在我一跑dotnet sdk就蓝屏重启, 但跑别的又没问题. 现在完全没法调, 先延下期... |
好的,预览版的东东少用,之前用过vs的预览版,做单元测试的时候差点把我搞崩溃 |
Updated:
|
😁 👍 等你的推送,我也测试下 |
@yyjdelete 我在 #65 中借用了 090b92d ,并做了些修改,重构了TlsHandler,做了些异常捕捉,确保 tlshandler 可以关闭,#46 可以杜绝了 |
@cuteant 好的, 有时间的时候我看下然后rebase之后重新push下 |
Check whether MqttServerAndClient will hit the assert in pipeline.=>It hit the assert
Actual fix is not included.
(I do this later when I'm free, and the fix should like Azure/DotNetty#374)