SSL unexpected EOF error due to non-blocking CircularBufferStream
See original GitHub issueTo 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.
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
"Unexpected EOF" SSL error when registering system to ...
Issue. There was an SSL error: (-1, 'Unexpected EOF') A common cause of this error is the system time being incorrect. Verify that...
Read more >SSL error "unexpected eof while reading" on same ...
First, I'm aware of the SSL Library Error: error:0A000126:SSL routines::unexpected eof while reading error stemming from OpenSSL 3 ...
Read more >Net::FTPSSL giving error Unexpected EOF on Command ...
I'm trying to use Perl and Net::FTPSSL on an ubuntu server to upload a local file to an externally hosted webserver. The login...
Read more >Warning: fread(): SSL routines::unexpected eof
I'm using OpenSSL v3.0.7 on CentOS9, I used to run on CentOS6 with OpenSSL v1.0.2k-fips which was fine. I do not have FIPS...
Read more >Host disconnects from vCenter Server with the error: Got ...
Host disconnects from vCenter Server with the error: Got vmacore exception: SSL Exception: Unexpected EOF (2064246). Symptoms.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@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.