Trying to connect to TLS 1.2 enabled Sql Server from .Net Core client
See original GitHub issueHi,
I have got a client (container application) in .net core and trying to connect to TLS 1.2 enabled Sql server.
When the Sql server was not configured the client can talk to database but after enabling TLS 1.2 it started throwing below error:
Error: The connection is broken and recovery is not possible. The client driver attempted to recover the connection one or more times and all attempts failed. Increase the value of ConnectRetryCount to increase the number of recovery attempts.
at System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(IAsyncResult asyncResult)
at System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func
2 endFunction, Action1 endAction, Task
1 promise, Boolean requiresSynchronization)
— End of stack trace from previous location where exception was thrown
Can you please assist on this?
Thanks, Muhammad Masood
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (4 by maintainers)
Hi, It can talk to database server with TLS 1.2 enabled. Here is part of my Dockerfile:
COPY ./Certificates/db.cer /etc/pki/ca-trust/source/anchors/db.cer RUN update-ca-trust
Thanks, Muhammad Masood
Hi, I followed https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-encrypted-connections?view=sql-server-2017 and added CA signed cert to the container and it can talk to database now. But currently server is not forcing for TLS 1.2 (it is enabled) so I am waiting for dba to make this happen in database and see how container will behave after that. I will update you guys.
Thanks a lot.