3
votes

Upgraded mssql-server this morning and I can't connect to it anymore

sqlcmd -S localhost -U SA -P xxxxxxxx

Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : TCP Provider: Error code 0x2746. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Client unable to establish connection.

From SSMS:

A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0) (Microsoft SQL Server, Error: 10054)

OS Debian 9 up-to-date

OpenSSL OpenSSL 1.0.1t 3 May 2016 and OpenSSL 1.1.1c 28 May 2019

SQL Server SQL Server 2017

2
This answer would probably help: stackoverflow.com/a/61111267/9535070 - ofundefined

2 Answers

5
votes

The reason why you are having issues with this is because SQL Server 2017/2019 packages meant for Ubuntu 16.04 have a dependency on OpenSSL version 1.0. While your Debian openssl seems to be on 1.1. Until we get a package meant for Ubuntu 18.04 with openssl 1.1 updates, you can follow the steps in additional note of following blog and create links to libssl.so and libcrypto.so for version 1.0 into /opt/mssql/lib path.

https://techcommunity.microsoft.com/t5/SQL-Server/Installing-SQL-Server-2017-for-Linux-on-Ubuntu-18-04-LTS/ba-p/385983

Once the appropriate links are created, the connectivity to SQL Server should work.

3
votes

I meant the steps about creating softlinks for libssl.so and libcrypto.so to /opt/mssql/lib folder. First "locate" these two files similar to below.

root@gf-sql19-ub:/# locate libcrypto.so
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
root@gf-sql19-ub:/# locate libssl.so
/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0
/usr/lib/x86_64-linux-gnu/libssl.so.1.1

once you have located the links create soft links. (Note, if paths for debian 9 are different, change them accordingly. If you do not find these two files, then you may have to manually install openssl 1.0 packages manually from debian9 repo and locate those files.)

cd /opt/mssql/lib
ln -s /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 libcrypto.so
ln -s /usr/lib/x86_64-linux-gnu/libssl.so.1.0.0 libssl.so