IrcDotNet: SSL unexpected EOF error due to non-blocking CircularBufferStream
To reproduce:
- Fresh clone of the repository, open the sln
- Open IrcBot.cs, change line 159 to
client.Connect(server, true, registrationInfo);
(to enable ssl). - Start the “MarkovTextBot” sample
- When prompted, enter “connect chat.freenode.net” (which listens on port 6697 for SSL connections)
The following exception is thrown:
System.AggregateException occurred
HResult=0x80131500
Message=One or more errors occurred.
Source=<Cannot evaluate the exception source>
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at IrcDotNet.StandardIrcClient.GetDataStream(Boolean useSsl, String targetHost) in C:\Documents\projects\IrcDotNet\source\IrcDotNet\StandardIrcClient.cs:line 592
at IrcDotNet.StandardIrcClient.ConnectCompleted(Object sender, SocketAsyncEventArgs e) in C:\Documents\projects\IrcDotNet\source\IrcDotNet\StandardIrcClient.cs:line 444
at System.Net.Sockets.SocketAsyncEventArgs.OnCompleted(SocketAsyncEventArgs e)
at System.Net.Sockets.SocketAsyncEventArgs.ExecutionCallback(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
Inner Exception 1:
IOException: Received an unexpected EOF or 0 bytes from the transport stream.
Where the InnerException is:
System.IO.IOException: Received an unexpected EOF or 0 bytes from the transport stream.
at System.Net.FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Net.Security.SslState.InternalEndProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at System.Net.Security.SslStream.EndAuthenticateAsClient(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
I tried the same with another IRC server (also over SSL), with the same result.
About this issue
- Original URL
- State: open
- Created 7 years ago
- Comments: 15 (1 by maintainers)
@canton7, Hi, after seeing there are no maintainers, i asked by the Owner and became a Maintainer. I will soon start updating the libraries and my first goals will be fixing crashes. If you will be patient a bit more, i will check this matter and hope to implement a fix soon.
Does anyone have a temp workaround for this issue? It’s very crippling, with more and more IRC networks going SSL only.