-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
SQL Server pre-login handshake failed Android 5,6,8.1 #6859
Comments
Generally best practice would be to not connect directly to a database from a mobile application where you'll risk the server credentials being discoverable. Aside from that, @jonpryor any ideas? |
This won't be MAUI specific in any case, right? Like with that other issue linked, this stack is entirely Android and that would point to it being a net6-android issue (or at least something you need to change at a project level). |
Should we move this to the xamarin-android repo? |
I'll let @jonpryor handle moving and closing as necessary. Unfortunately we can't move issues across orgs with GitHub, it has to be 'manually' moved. |
I have magic tools that can do this (it just automates the manual steps using APIs). |
This issue was moved to dotnet/android#6990 |
It looks like I don't have permission to move this to https://github.com/dotnet/SqlClient. Will check on another option. |
Description
SQL Server - the connection was established but pre-login handshake failed when calling database via Entity Framework
**Microsoft.Data.SqlClient.SqlException:** 'A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)'
What does not help:
Encrypt=false
in connection stringEncrypt=true
in connection stringEncrypt=false;TrustServerCertificate=true;
in connection stringThe same works without any issue on Android 9 and up (both emulator and real device).
Tested: works on Android 9 for all TLS settings:
Native TLS 1.2+
andManaged TLS 1.0
and also for"no option"
.The issue is in Debug (and thus probably also in Release) configuration.
Output for Android 5 (API 21):
Microsoft.Data.SqlClient.SqlException: 'A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: TCP Provider, error: 35 - An internal exception was caught)'
Output for Android 8, for all TLS configuration options:
Native TLS 1.2+
andManaged TLS 1.0
and also for"no option"
.Similar issues:
#3522
Steps to Reproduce
call database in a MAUI app with Android 8.1 or lower
Version with bug
Release Candidate 2 (current)
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 8.1 and below
Did you find any workaround?
no
Relevant log output
No response
The text was updated successfully, but these errors were encountered: