SSL Provider error 31 when connecting to SQL in a docker container

I recently bought a Dell XPS 13 running Ubuntu 16.04 and ran into an issue when connecting SQL Operations Studio (version 0.31.4) to SQL 2017 CU9 running in a docker container. Other people seem to encountering this issue as well so am posting it so that it may be of some help to someone in the future.

The error generated was: –

System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 31)

The full error can be viewed here

I was a bit stumped with this one to be honest, I googled around but could not find a resolution.

So I reached out on twitter to get some help: –

I also logged an issue on the SQL Operations Studio Github

Thankfully I got a response from Kevin Cunnane (t): –

Kevin advised me to run: –

sudo update-ca-certificates --fresh

N.B. – See here for a detailed description of what this command does

Once I ran that I was able to connect to SQL running in a docker container from SQL Operations Studio. Many thanks Kevin!

Hope that helps!