-
-
Notifications
You must be signed in to change notification settings - Fork 1
Description
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);