How to fix Microsoft ODBC Driver 17 for SQL Server : SSL Provider ssl_choose_client_version:unsupported protocol
Solution 1:
The reason might be that your current openssl doesn't support / turned off some ciphers (supported by your previous installation) and the server requires them. Just compare output:
nmap --script ssl-enum-ciphers localhost
nmap --script ssl-enum-ciphers <DB SERVER IP>
Solution: try to install a new version of openssl (>1.1.1f) manually. I upgraded from 1.1.1f to 1.1.1h and it solved my problems, no extra configuration required. I also read similar cases with 18.04 -> 20.04 and 1.1.1f which affected other guys.
The manual installation looks like:
wget https://www.openssl.org/source/latest.tar.gz -O openssl-1.1.1h.tar.gz
tar -zxvf openssl-1.1.1h.tar.gz
cd openssl-1.1.1h
./config
make
sudo make install
sudo ldconfig
openssl version
Note: You can also avoid the first line above and manually download the source tar.gz by going to their download page.
Hope, this will help
Note if after the download and tar un-compress the directory is something like openssl-3.0.0
then change to that directory instead, run the steps above, but if openssl version fails with an error
error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
you need to copy a few more files:
sudo cp /usr/local/lib64/libcrypto.so.3 /usr/lib
sudo cp /usr/local/lib64/libssl.so.3 /usr/lib
sudo cp /usr/local/lib64/libssl.so /usr/lib
and finally, update the dynamic linker's links and cache:
sudo ldconfig