ReadAsync throws open SSL error for specific table on Linux on Azure
See original GitHub issueDescribe the bug
When connecting to SQL Server on Azure with Linux client we get a SQLException that has a error linked to OpenSSL. We tried both Ubuntu 18x and Ubuntu 19x and same error.
Oddly enough, this error happens on a very specific table. Also same error with older client System.Data.SqlClient This is on net core preview 7
Exception message:
Stack trace:
---> System.Data.SqlClient.SqlException (0x80131904): A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 35 - An internal exception was caught)
---> System.IO.IOException: The decryption operation failed, see inner exception.
---> Interop+OpenSsl+SslException: Decrypt failed with OpenSSL error - SSL_ERROR_SSL.
---> Interop+Crypto+OpenSslCryptographicException: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
--- End of inner exception stack trace ---
at Interop.OpenSsl.Decrypt(SafeSslHandle context, Byte[] outBuffer, Int32 offset, Int32 count, SslErrorCode& errorCode)
at System.Net.Security.SslStreamPal.EncryptDecryptHelper(SafeDeleteContext securityContext, ReadOnlyMemory`1 input, Int32 offset, Int32 size, Boolean encrypt, Byte[]& output, Int32& resultSize)
--- End of inner exception stack trace ---
at System.Net.Security.SslStream.ReadAsyncInternal[TReadAdapter](TReadAdapter adapter, Memory`1 buffer)
at System.Data.SqlClient.SNI.SNIPacket.<ReadFromStreamAsync>g__ReadFromStreamAsync|27_0(SNIPacket packet, SNIAsyncCallback cb, ValueTask`1 valueTask)
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParserStateObject.ReadAsyncCallbackCaptureException(TaskCompletionSource`1 source)
--- End of stack trace from previous location where exception was thrown ---
at Apption.DBConnectors.SQLServer.SQLServerTableMetadata.ReadTable(SQLDatabase database, SQLTable table, ITargetBlock`1 target)
Expected behavior
SQL Clients reads data correctly from source data.
Further technical details
Microsoft.Data.SqlClient version: 1.0.19189.1 SQL Server version: Azure SQL Server Operating system: Ubuntu 18.04 docker container
Additional context Error seems to be related to SSL version https://stackoverflow.com/questions/29627991/1408f10bssl-routinesssl3-get-recordwrong-version-number-call-on-indy
Issue Analytics
- State:
- Created 4 years ago
- Comments:22 (20 by maintainers)
Top Results From Across the Web
Troubleshoot domain and TLS/SSL certificates - Azure App ...
Find solutions to the common problems that you might encounter when you configure a domain or TLS/SSL certificate in Azure App Service.
Read more >Troubleshoot RHUI certificate issues in Azure
Troubleshoot common Red Hat Update Infrastructure certificate issues in Azure that are caused by expired or missing TLS or SSL certificates.
Read more >error:14094415:SSL routines:ssl3_read_bytes:sslv3 alert ...
Azure RHEL 8 Virtual machines are unable to download any rpms from RHEL repos due to "OpenSSL SSL_read: error:14094415:SSL routines:ssl3_read_bytes:sslv3 ...
Read more >Connect to Azure Database for MySQL - Flexible Server ...
Instructions and information on how to connect using TLS/SSL in Azure Database for MySQL - Flexible Server.
Read more >SSL error while doing a request for Microsoft graph api
I trying to get integrate Microsoft Graph API into the airflow application docker-compose. And I have a self-signed SSL certificate WARNING ...
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
Well I’m sorry I broke it in the first place. It’s been a bad day for my quality of my work.
Sorry for my impatience to get this fix out in a hurry, but I really believe that it is urgent now where ef core relies on M.D.SqlClient. It’s release is imminent and it will have a dependency with this fatal issue. I really hope that a patch release will be out asap.
I created https://github.com/aspnet/EntityFrameworkCore/issues/17592 to track the update of the reference if this gets a patch release before the ef core release
Cc @cheenamalhotra @David-Engel @Divega