Skip to content

IOException: Received an unexpected EOF or 0 bytes from the transport stream. #8

@ASlepushko

Description

@ASlepushko

Issue IOException: Received an unexpected EOF or 0 bytes from the transport stream.
System.Net.FixedSizeReader.ReadPacket(Stream transport, byte[] buffer, int offset, int count)

invoke MySqlException: Couldn't connect to server
MySqlConnector.Core.ServerSession.ConnectAsync(ConnectionSettings cs, ILoadBalancer loadBalancer, IOBehavior ioBehavior, CancellationToken cancellationToken) in ServerSession.cs, line 380

StackOverflow suggestions:

Following the trail of setting the ServicePointManager.SecurityProtocol static ctor with a SecurityProtocolType, I found mention of another enum called SslPolicy -- further research found that AuthenicateAsClient has an overload that takes SslPolicy as an argument.

Changing this line in the above code fixed this problem:

sslStream.AuthenticateAsClient(serverName, null, SslPolicy.Tls, false);

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions