8000 SSL Authentication Error - A call to SSPI failed, see inner exception. · Issue #428 · mysql-net/MySqlConnector · GitHub
[go: up one dir, main page]

Skip to content

SSL Authentication Error - A call to SSPI failed, see inner exception. #428

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

8000 Closed
kg6zgj opened this issue Jan 24, 2018 · 7 comments
Closed

Comments

@kg6zgj
Copy link
kg6zgj commented Jan 24, 2018

This is a portion of the exception json log.

The strange thing is i am not using ssl.

"_index": "log-2018.01.24",
"_type": "logEvent",
"_id": "AWEp3wn8NcVp4M8On1s1",
"_version": 1,
"_score": null,
"_source": {
"timeStamp": "2018-01-24T20:32:18.2730385Z",
"message": "Application error",
"messageObject": {},
"exception": {
"Type": "MySql.Data.MySqlClient.MySqlException",
"Message": "SSL Authentication Error",
"HelpLink": null,
"Source": "MySqlConnector",
"HResult": -2147467259,
"StackTrace": " at MySql.Data.Serialization.MySqlSession.d__67.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter.GetResult()
 at MySql.Data.Serialization.MySqlSession.d__52.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at MySql.Data.MySqlClient.MySqlConnection.d__79.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at MySql.Data.MySqlClient.MySqlConnection.d__19.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
 at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
 at MySql.Data.MySqlClient.MySqlConnection.Open()
 at Microsoft.EntityFrameworkCore.Storage.Internal.MySqlConnectionSettings.<>c__DisplayClass2_0.b__0(String key)
 at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
 at System.Lazy1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
 at System.Lazy1.get_Value()
 at Microsoft.EntityFrameworkCore.Storage.Internal.MySqlSmartTypeMapper.MaybeConvertMapping(RelationalTypeMapping mapping)
 at Microsoft.EntityFrameworkCore.Storage.RelationalTypeMapper.IsTypeMapped(Type clrType)
 at System.Linq.Enumerable.WhereArrayIterator1.MoveNext()
 at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.PropertyDiscoveryConvention.Apply(InternalEntityTypeBuilder entityTypeBuilder)
 at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ImmediateConventionScope.OnEntityTypeAdded(InternalEntityTypeBuilder entityTypeBuilder)
 at Microsoft.EntityFrameworkCore.Metadata.Internal.Model.AddEntityType(EntityType entityType)
 at Microsoft.EntityFrameworkCore.Metadata.Internal.InternalModelBuilder.Entity(TypeIdentity type, ConfigurationSource configurationSource)
 at Microsoft.EntityFrameworkCore.Metadata.Internal.InternalModelBuilder.Entity(Type type, ConfigurationSource configurationSource)
 at Microsoft.EntityFrameworkCore.ModelBuilder.Entity(Type type)
 at Microsoft.EntityFrameworkCore.Infrastructure.ModelCustomizer.FindSets(ModelBuilder modelBuilder, DbContext context)
 at Microsoft.EntityFrameworkCore.Infrastructure.RelationalModelCustomizer.FindSets(ModelBuilder modelBuilder, DbContext context)
 at Microsoft.EntityFrameworkCore.Infrastructure.ModelCustomizer.Customize(ModelBuilder modelBuilder, DbContext context)
 at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder, IModelValidator validator)
 at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
 at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel()
 at Microsoft.EntityFrameworkCore.Internal.DbContextServices.get_Model()
 at lambda_method(Closure , ServiceProvider )
 at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
 at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
 at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
 at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
 at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
 at Microsoft.EntityFrameworkCore.DbContext.get_Model()
 at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityType()
 at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.get_EntityQueryable()
 at Microsoft.EntityFrameworkCore.Internal.InternalDbSet1.System.Linq.IQueryable.get_Provider()
 at System.Linq.Queryable.Any[TSource](IQueryable1 source, Expression1 predicate)
 at Chatbooks.Core.Vocabluary.Using[T,TResult](Func1 init, Func2 func)
 at folkstory.Global.Application_PreRequestHandlerExecute(Object send, EventArgs e) in C:\TeamCity\buildAgent\work\53f103504e450429\trunk\folkstory\Website\Global.asax.cs:line 140
 at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
 at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)",
"Data": {},
"InnerException": {
"Type": "System.Security.Authentication.AuthenticationException",
"Message": "A call to SSPI failed, see inner exception.",
"HelpLink": null,
"Source": "System",
"HResult": -2146233087,
"StackTrace": " at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
 at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
 at MySql.Data.Serialization.MySqlSession.d__67.MoveNext()",
"Data": {},
"InnerException": {
"Type": "System.ComponentModel.Win32Exception",
"Message": "The message received was unexpected or badly formatted",
"HelpLink": null,
"Source": null,
"HResult": -2147467259,
"StackTrace": null,
"Data": {},
"InnerException": null
}
}
},
@bgrainger
Copy link
Member

What version of MySqlConnector are you using? (It does not appear to be a recent one.)

SSL is on by default (if the server supports it); use SslMode=None in your connection string to explicitly disable it.

Otherwise, it looks like this is an error from System.Net.Security.SslState.StartSendAuthResetSignal that's just being propagated through MySqlConnector. It's possible this might be caused by connecting to a MySQL Server that only supports TLS 1.2; on Windows we have to disable that TLS protocol due to the reasons given in #101. What MySQL Server and version are you connecting to?

@kg6zgj
Copy link
Author
kg6zgj commented Jan 25, 2018

Thank you for the help! We are using 0.29.4 of MysqlConnector and Aurora MySQL 5.6.10a. We should probably update here soon! Thank you for making this library btw! You are awesome! I think for my situation I will make sure not to use ssl since we don't connect outside our network vpc right now. so that solution should work, I will try it and get back to this thread.

@kg6zgj kg6zgj closed this as completed Jan 25, 2018
@infiniteloopltd
Copy link

Try setting the TLS version to 1.2 globally?

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

@bgrainger
Copy link
Member

@infiniteloopltd That only affects HTTPS connections (so is not relevant to MySqlConnector); see https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls for more details.

@shuangyuxiaoyi
Copy link

@kg6zgj Is this solved? I got the same issue recently.

@bgrainger
Copy link
Member

This appears to be an Aurora-related issue: #576 (comment)

The workaround is to retry opening the connection. If you're using Pomelo.EntityFrameworkCore.MySql, you might want to try setting MySqlDbContextOptionsBuilder.EnableRetryOnFailure.

@shuangyuxiaoyi
Copy link
shuangyuxiaoyi commented May 23, 2019 via email

4B0A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants
0