<p>I have a backgroundservice built in .Net Core that executes a SQL Server database procedure as follows:</p>
<pre><code>public int ExecuteProcedure(string connectionString, string sql, Dictionary&lt;string, object&gt; parameters = null)
{
        var response = -99;
        using (SqlConnection connection = new SqlConnection(connectionString))
        {
            connection.Open();
            // Create a SqlCommand, and identify it as a stored procedure.
            using (SqlCommand sqlCommand = new SqlCommand(sql, connection))
            {
                sqlCommand.CommandType = CommandType.StoredProcedure;
                if(parameters != null)
                    SetParameters(sqlCommand, parameters);
                response = sqlCommand.ExecuteNonQuery();
            }
            connection.Close();
        }

        return response;
}
</code></pre>
<p>When I run the bakcgroundservice <strong>on my local machine it runs without problems but when I use docker and kubernetes</strong> I get the following error:</p>
<blockquote>
<p>A connection was successfully established with the server, but then an
error occurred during the pre-login handshake. (provider: TCP
Provider, <strong>error: 35</strong> - An internal exception was caught)</p>
</blockquote>
<p>I have consulted in several places but all the answers I find are about restarting Visual Studio or IIS which does not apply in my case due to having the application in kubernetes</p>
<p>I would greatly appreciate your help.</p>

<p>The error is presented <strong>by the image</strong> used when building the docker container.</p>
<p>I was using the image: <code>mcr.microsoft.com/dotnet/core/runtime:3.1-buster-slim</code> but when I changed it to: <code>mcr.microsoft.com/dotnet/core/runtime:3.1-bionic</code> worked fine.</p>
<p>From what I have been consulting it seems that the image that was failing me has a version of the TLS that is not compatible to make the successful connection with SqlServer</p>
